Speed up integration test and make cleanup easier by using labels

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
Daniel Nephin 2015-05-30 16:17:21 -04:00
commit 60351a8e07
10 changed files with 47 additions and 53 deletions

View file

@ -216,18 +216,19 @@ class ServiceStateTest(DockerClientTestCase):
def test_trigger_recreate_with_build(self):
context = tempfile.mkdtemp()
base_image = "FROM busybox\nLABEL com.docker.compose.test_image=true\n"
try:
dockerfile = os.path.join(context, 'Dockerfile')
with open(dockerfile, 'w') as f:
f.write('FROM busybox\n')
f.write(base_image)
web = self.create_service('web', build=context)
container = web.create_container()
with open(dockerfile, 'w') as f:
f.write('FROM busybox\nCMD echo hello world\n')
f.write(base_image + 'CMD echo hello world\n')
web.build()
web = self.create_service('web', build=context)