Added unit test for create_container with volumes_from

This commit is contained in:
shin- 2014-04-04 17:11:00 +02:00
parent ad75b37a46
commit a37d0eea16
1 changed files with 14 additions and 0 deletions

View File

@ -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',