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

Method test_build_invalid_platform

tests/ssh/api_build_test.py:435–446  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

is_errorMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected