Fix mock order

As per [1], the order of the created mocks passed into test function must
matches the decorators apply order(from the bottom upwards).

[1] http://www.voidspace.org.uk/python/mock/patch.html#nesting-patch-decorators

Change-Id: I139f78f25c32cf82c9d4b4d4d3a2852a23fab89c
This commit is contained in:
Dongcan Ye 2016-12-12 13:36:45 +08:00
parent bd84c9f281
commit efe0078d36
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ class BindingTest(base.TestCase):
return_value=mock_create)
@mock.patch('pyroute2.ipdb.interface.InterfacesDict.__getitem__',
return_value=mock_interface)
def test_port_bind(self, mock_getattribute, mock_getitem,
def test_port_bind(self, mock_getitem, mock_getattribute,
mock_execute, mock_path_exists):
fake_mtu = 1450
fake_docker_network_id = utils.get_hash()