Add test to check for the absence of volumes_from

This commit is contained in:
Felipe Bessa Coelho 2014-04-09 13:10:08 -03:00
parent 3198dd9fde
commit 16ad8198a9
1 changed files with 9 additions and 0 deletions

View File

@ -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: