mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
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 docker.networks -
as the mock didn't have this set the test started failing.
This commit is contained in:
parent
d42f781c64
commit
d31f2913bd
1 changed files with 5 additions and 1 deletions
|
@ -69,10 +69,14 @@ class DockerNetworkTestCase(TestCase, LoaderModuleMockMixin):
|
|||
'''
|
||||
docker_remove_network = Mock(return_value='removed')
|
||||
docker_disconnect_container_from_network = Mock(return_value='disconnected')
|
||||
docker_networks = Mock(return_value=[{
|
||||
'Name': 'network_foo',
|
||||
'Containers': {'container': {}}
|
||||
}])
|
||||
__salt__ = {
|
||||
'docker.remove_network': docker_remove_network,
|
||||
'docker.disconnect_container_from_network': docker_disconnect_container_from_network,
|
||||
'docker.networks': Mock(return_value=[{'Containers': {'container': {}}}]),
|
||||
'docker.networks': docker_networks,
|
||||
}
|
||||
with patch.dict(docker_state.__dict__,
|
||||
{'__salt__': __salt__}):
|
||||
|
|
Loading…
Add table
Reference in a new issue