Test commit changes param

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2016-03-23 12:17:22 -07:00
parent 9505b3e8b5
commit cf83119882
1 changed files with 14 additions and 0 deletions

View File

@ -90,6 +90,20 @@ class CommitTest(helpers.BaseTestCase):
self.assertIn('Parent', img)
self.assertEqual(img['Parent'], busybox_id)
def test_commit_with_changes(self):
cid = self.client.create_container(BUSYBOX, ['touch', '/test'])
self.tmp_containers.append(cid)
self.client.start(cid)
img_id = self.client.commit(
cid, changes=['EXPOSE 8000', 'CMD ["bash"]']
)
self.tmp_imgs.append(img_id)
img = self.client.inspect_image(img_id)
assert 'Container' in img
assert img['Container'].startswith(cid['Id'])
assert '8000/tcp' in img['Config']['ExposedPorts']
assert img['Config']['Cmd'] == ['bash']
class RemoveImageTest(helpers.BaseTestCase):
def test_remove(self):