From a37d0eea16a611227d8a422c84f87b921c99b053 Mon Sep 17 00:00:00 2001 From: shin- Date: Fri, 4 Apr 2014 17:11:00 +0200 Subject: [PATCH] Added unit test for create_container with volumes_from --- tests/test.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test.py b/tests/test.py index 2cdb09ca..4de58b93 100644 --- a/tests/test.py +++ b/tests/test.py @@ -328,6 +328,20 @@ class DockerClientTest(unittest.TestCase): self.assertEqual(args[1]['headers'], {'Content-Type': 'application/json'}) + def test_create_container_with_volumes_from(self): + vol_names = ['foo', 'bar'] + try: + self.client.create_container('busybox', 'true', + volumes_from=vol_names) + except Exception as e: + self.fail('Command should not raise exception: {0}'.format(e)) + args = fake_request.call_args + self.assertEqual(args[0][0], url_prefix + 'containers/create') + self.assertEqual(json.loads(args[1]['data'])['VolumesFrom'], + ','.join(vol_names)) + self.assertEqual(args[1]['headers'], + {'Content-Type': 'application/json'}) + def test_create_named_container(self): try: self.client.create_container('busybox', 'true',