MCPcopy Index your code
hub / github.com/docker/docker-py / test_build

Method test_build

tests/integration/models_images_test.py:14–21  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

12class ImageCollectionTest(BaseIntegrationTest):
13
14 def test_build(self):
15 client = docker.from_env(version=TEST_API_VERSION)
16 image, _ = client.images.build(fileobj=io.BytesIO(
17 b"FROM alpine\n"
18 b"CMD echo hello world"
19 ))
20 self.tmp_imgs.append(image.id)
21 assert client.containers.run(image) == b"hello world\n"
22
23 # @pytest.mark.xfail(reason='Engine 1.13 responds with status 500')
24 def test_build_with_error(self):

Callers

nothing calls this directly

Calls 3

from_envMethod · 0.80
runMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected