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

Method test_build_invalid_platform

tests/integration/api_build_test.py:444–455  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

442 @requires_api_version('1.32')
443 @requires_experimental(until=None)
444 def test_build_invalid_platform(self):
445 script = io.BytesIO(b'FROM busybox\n')
446
447 with pytest.raises(errors.APIError) as excinfo:
448 stream = self.client.build(fileobj=script, platform='foobar')
449 for _ in stream:
450 pass
451
452 # Some API versions incorrectly returns 500 status; assert 4xx or 5xx
453 assert excinfo.value.is_error()
454 assert 'unknown operating system' in excinfo.exconly() \
455 or 'invalid platform' in excinfo.exconly()
456
457 def test_build_out_of_context_dockerfile(self):
458 base_dir = tempfile.mkdtemp()

Callers

nothing calls this directly

Calls 2

is_errorMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected