(self)
| 324 | class ContainerTest(BaseIntegrationTest): |
| 325 | |
| 326 | def test_commit(self): |
| 327 | client = docker.from_env(version=TEST_API_VERSION) |
| 328 | container = client.containers.run( |
| 329 | "alpine", "sh -c 'echo \"hello\" > /test'", |
| 330 | detach=True |
| 331 | ) |
| 332 | self.tmp_containers.append(container.id) |
| 333 | container.wait() |
| 334 | image = container.commit() |
| 335 | assert client.containers.run( |
| 336 | image.id, "cat /test", remove=True |
| 337 | ) == b"hello\n" |
| 338 | |
| 339 | def test_diff(self): |
| 340 | client = docker.from_env(version=TEST_API_VERSION) |