File tree 2 files changed +8
-4
lines changed 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -448,8 +448,10 @@ def test_build_invalid_platform(self):
448
448
for _ in stream :
449
449
pass
450
450
451
- assert excinfo .value .status_code == 400
452
- assert 'invalid platform' in excinfo .exconly ()
451
+ # Some API versions incorrectly returns 500 status; assert 4xx or 5xx
452
+ assert excinfo .value .is_error ()
453
+ assert 'unknown operating system' in excinfo .exconly () \
454
+ or 'invalid platform' in excinfo .exconly ()
453
455
454
456
def test_build_out_of_context_dockerfile (self ):
455
457
base_dir = tempfile .mkdtemp ()
Original file line number Diff line number Diff line change @@ -69,8 +69,10 @@ def test_pull_invalid_platform(self):
69
69
with pytest .raises (docker .errors .APIError ) as excinfo :
70
70
self .client .pull ('hello-world' , platform = 'foobar' )
71
71
72
- assert excinfo .value .status_code == 500
73
- assert 'invalid platform' in excinfo .exconly ()
72
+ # Some API versions incorrectly returns 500 status; assert 4xx or 5xx
73
+ assert excinfo .value .is_error ()
74
+ assert 'unknown operating system' in excinfo .exconly () \
75
+ or 'invalid platform' in excinfo .exconly ()
74
76
75
77
76
78
class CommitTest (BaseAPIIntegrationTest ):
You can’t perform that action at this time.
0 commit comments