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

Method test_import_image_from_bytes

tests/unit/api_image_test.py:154–176  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

152 )
153
154 def test_import_image_from_bytes(self):
155 stream = (i for i in range(0, 100))
156
157 self.client.import_image(
158 stream,
159 repository=fake_api.FAKE_REPO_NAME,
160 tag=fake_api.FAKE_TAG_NAME
161 )
162
163 fake_request.assert_called_with(
164 'POST',
165 f"{url_prefix}images/create",
166 params={
167 'repo': fake_api.FAKE_REPO_NAME,
168 'tag': fake_api.FAKE_TAG_NAME,
169 'fromSrc': '-',
170 },
171 headers={
172 'Content-Type': 'application/tar',
173 },
174 data=stream,
175 timeout=DEFAULT_TIMEOUT_SECONDS
176 )
177
178 def test_import_image_from_image(self):
179 self.client.import_image(

Callers

nothing calls this directly

Calls 1

import_imageMethod · 0.80

Tested by

no test coverage detected