Fix broken unit test test_network_absent

This started failing following commit 515c612, which relied on the
'Name' key being present in the return value of dockerng.networks -
as the mock didn't have this set the test started failing.
This commit is contained in:
Andrew Bulford 2017-06-30 11:01:10 +01:00
parent 0ef6cf634c
commit 3369f0072f

View file

@ -724,9 +724,13 @@ class DockerngTestCase(TestCase):
'''
dockerng_remove_network = Mock(return_value='removed')
dockerng_disconnect_container_from_network = Mock(return_value='disconnected')
dockerng_networks = Mock(return_value=[{
'Name': 'network_foo',
'Containers': {'container': {}}
}])
__salt__ = {'dockerng.remove_network': dockerng_remove_network,
'dockerng.disconnect_container_from_network': dockerng_disconnect_container_from_network,
'dockerng.networks': Mock(return_value=[{'Containers': {'container': {}}}]),
'dockerng.networks': dockerng_networks,
}
with patch.dict(dockerng_state.__dict__,
{'__salt__': __salt__}):