Fix mock of built in "open" function in unit tests

Closes-Bug: #1832352
Change-Id: I37ac054bf8a7ae78492f2c1923ff9dad6a702d9d
This commit is contained in:
Hamdy Khader 2019-06-11 15:24:54 +03:00
parent 983bfdee50
commit 1eef2d8a58

View File

@ -82,7 +82,7 @@ class LinuxNetTest(testtools.TestCase):
@mock.patch.object(os.path, 'exists', return_value=True)
@mock.patch.object(builtins, 'open')
def test__arp_filtering(self, mock_open, *args):
mock_open.side_effect = mock.mock_open(read_data=mock.Mock())
mock_open.side_effect = mock.mock_open()
linux_net._arp_filtering("br0")
mock_open.assert_has_calls([