Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_pull_image(self):
TEST_IMAGE='alpine:latest'
docker_client = get_docker_client()
l = docker_client.images()
tags = set(chain.from_iterable([i['RepoTags'] for i in l if i['RepoTags']]))
print(tags)
if TEST_IMAGE in tags:
docker_client.remove_image(TEST_IMAGE)
print('removed image %s' % TEST_IMAGE)
self.assertTrue(pull_image(TEST_IMAGE))
def test_failed_pull_image(self):
self.assertFalse(pull_image("osrf/ros:does_not_exist"))