summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAanand Prasad <aanand.prasad@gmail.com>2016-01-25 18:19:32 +0000
committerAanand Prasad <aanand.prasad@gmail.com>2016-01-25 18:19:32 +0000
commit403d271cc2e954a34c8c01dea32097fe8549cbe6 (patch)
treea85e30e6c810df0aadcb8d47e2c0755836662c81 /tests
parentce8a02f7137bbfdee7e03b48bb50f5a789f7937a (diff)
downloaddocker-py-403d271cc2e954a34c8c01dea32097fe8549cbe6.tar.gz
Raise exceptions for API errors on network connect/disconnect
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/network_test.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/integration/network_test.py b/tests/integration/network_test.py
index 51cc53a..a379bbf 100644
--- a/tests/integration/network_test.py
+++ b/tests/integration/network_test.py
@@ -117,10 +117,16 @@ class TestNetworks(helpers.BaseTestCase):
list(network_data['Containers'].keys()),
[container['Id']])
+ with pytest.raises(docker.errors.APIError):
+ self.client.connect_container_to_network(container, net_id)
+
self.client.disconnect_container_from_network(container, net_id)
network_data = self.client.inspect_network(net_id)
self.assertFalse(network_data.get('Containers'))
+ with pytest.raises(docker.errors.APIError):
+ self.client.disconnect_container_from_network(container, net_id)
+
@requires_api_version('1.22')
def test_connect_with_aliases(self):
net_name, net_id = self.create_network()