From 16ad8198a9a9b6ecf341c2473bbb1f9ce0f7f03c Mon Sep 17 00:00:00 2001 From: Felipe Bessa Coelho Date: Wed, 9 Apr 2014 13:10:08 -0300 Subject: [PATCH] Add test to check for the absence of volumes_from --- tests/test.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test.py b/tests/test.py index 4de58b93..6832243f 100644 --- a/tests/test.py +++ b/tests/test.py @@ -341,6 +341,15 @@ class DockerClientTest(unittest.TestCase): ','.join(vol_names)) self.assertEqual(args[1]['headers'], {'Content-Type': 'application/json'}) + def test_create_container_empty_volumes_from(self): + try: + self.client.create_container('busybox', 'true', volumes_from=[]) + except Exception as e: + self.fail('Command should not raise exception: {0}'.format(e)) + + args = fake_request.call_args + data = json.loads(args[1]['data']) + self.assertTrue('VolumesFrom' not in data) def test_create_named_container(self): try: