def test_from_ps(self): container = Container.from_ps(None, self.container_dict, has_been_inspected=True) self.assertEqual(container.dictionary, { "Id": "abc", "Image":"busybox:latest", "Name": "/composetest_db_1", })
def test_from_ps(self): container = Container.from_ps(None, self.container_dict, has_been_inspected=True) assert container.dictionary == { "Id": self.container_id, "Image": "busybox:latest", "Name": "/composetest_db_1", }
def test_from_ps(self): container = Container.from_ps(None, self.container_dict, has_been_inspected=True) assert container.dictionary == { "Id": self.container_id, "Image": "busybox:latest", "Name": "/composetest_db_1", }
def test_from_ps(self): container = Container.from_ps(None, self.container_dict, has_been_inspected=True) self.assertEqual(container.dictionary, { "Id": "abc", "Image": "busybox:latest", "Name": "/composetest_db_1", })
def test_from_ps(self): container = Container.from_ps(None, self.container_dict, has_been_inspected=True) assert container.dictionary == { "Id": self.container_id, "Image": BUSYBOX_IMAGE_WITH_TAG, "Name": "/composetest_db_1", }
def test_build_failed(self): self.base_dir = "tests/fixtures/simple-failing-dockerfile" self.dispatch(["build", "simple"], returncode=1) labels = ["com.docker.compose.test_failing_image=true"] containers = [ Container.from_ps(self.project.client, c) for c in self.project.client.containers(all=True, filters={"label": labels}) ] assert len(containers) == 1
def test_build_failed(self): self.base_dir = 'tests/fixtures/simple-failing-dockerfile' self.dispatch(['build', 'simple'], returncode=1) labels = ["com.docker.compose.test_failing_image=true"] containers = [ Container.from_ps(self.project.client, c) for c in self.project.client.containers(all=True, filters={"label": labels}) ] assert len(containers) == 1
def test_from_ps_prefixed(self): self.container_dict['Names'] = ['/swarm-host-1' + n for n in self.container_dict['Names']] container = Container.from_ps(None, self.container_dict, has_been_inspected=True) self.assertEqual(container.dictionary, { "Id": "abc", "Image": "busybox:latest", "Name": "/composetest_db_1", })
def test_from_ps_prefixed(self): self.container_dict['Names'] = ['/swarm-host-1' + n for n in self.container_dict['Names']] container = Container.from_ps(None, self.container_dict, has_been_inspected=True) self.assertEqual(container.dictionary, { "Id": "abc", "Image":"busybox:latest", "Name": "/composetest_db_1", })
def test_from_ps_prefixed(self): self.container_dict['Names'] = [ '/swarm-host-1' + n for n in self.container_dict['Names'] ] container = Container.from_ps(None, self.container_dict, has_been_inspected=True) assert container.dictionary == { "Id": self.container_id, "Image": BUSYBOX_IMAGE_WITH_TAG, "Name": "/composetest_db_1", }
def test_build_failed_forcerm(self): self.base_dir = 'tests/fixtures/simple-failing-dockerfile' self.dispatch(['build', '--force-rm', 'simple'], returncode=1) labels = ["com.docker.compose.test_failing_image=true"] containers = [ Container.from_ps(self.project.client, c) for c in self.project.client.containers( all=True, filters={"label": labels}) ] assert not containers
def test_number(self): container = Container.from_ps(None, self.container_dict, has_been_inspected=True) self.assertEqual(container.number, 1)
def test_name(self): container = Container.from_ps(None, self.container_dict, has_been_inspected=True) self.assertEqual(container.name, "composetest_db_1")
def test_name(self): container = Container.from_ps(None, self.container_dict, has_been_inspected=True) self.assertEqual(container.name, "composetest_db_1")
def test_name_without_project(self): container = Container.from_ps(None, self.container_dict, has_been_inspected=True) self.assertEqual(container.name_without_project, "db_1")
def test_name_without_project(self): container = Container.from_ps(None, self.container_dict, has_been_inspected=True) self.assertEqual(container.name_without_project, "db_1")
def test_number(self): container = Container.from_ps(None, self.container_dict, has_been_inspected=True) self.assertEqual(container.number, 1)