diff options
| author | Sumit Sahrawat <sumit.sahrawat.apm13@iitbhu.ac.in> | 2015-12-03 20:24:30 +0530 |
|---|---|---|
| committer | Sumit Sahrawat <sumit.sahrawat.apm13@iitbhu.ac.in> | 2015-12-10 10:29:11 +0530 |
| commit | bd948be7d9bc712df80b965054fb877de9e3556d (patch) | |
| tree | 7a0e54e91098e7d0661869cb43653976b0b97f26 /tests/unit | |
| parent | 0f091747ece350d885f8d9829a488b63f3ff95c4 (diff) | |
| download | docker-py-bd948be7d9bc712df80b965054fb877de9e3556d.tar.gz | |
Allow providing options when creating networks
Following the spec:
http://docs.docker.com/engine/reference/api/docker_remote_api_v1.21/#create-a-network
I have added an Options argument to create_network.
This opens up the possibility of creating isolated containers with no
internet access programmatically. We require such facilities in
https://github.com/jupyter/tmpnb/issues/187.
Signed-off-by: Sumit Sahrawat <sumit.sahrawat.apm13@iitbhu.ac.in>
Diffstat (limited to 'tests/unit')
| -rw-r--r-- | tests/unit/network_test.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/unit/network_test.py b/tests/unit/network_test.py index 306ee4f..a41a980 100644 --- a/tests/unit/network_test.py +++ b/tests/unit/network_test.py @@ -70,11 +70,15 @@ class NetworkTest(DockerClientTest): json.loads(post.call_args[1]['data']), {"name": "foo"}) - self.client.create_network('foo', 'bridge') + opts = { + 'com.docker.network.bridge.enable_icc': False, + 'com.docker.network.bridge.enable_ip_masquerade': False, + } + self.client.create_network('foo', 'bridge', opts) self.assertEqual( json.loads(post.call_args[1]['data']), - {"name": "foo", "driver": "bridge"}) + {"name": "foo", "driver": "bridge", "options": opts}) @base.requires_api_version('1.21') def test_remove_network(self): |
