Skip to content

Commit e5c3eb1

Browse files
committed
integration: adjust tests for omitted "OnBuild"
The Docker API may either return an empty "OnBuild" or omit the field altogether if it's not set. Adjust the tests to make either satisfy the test. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent db7f8b8 commit e5c3eb1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/integration/api_build_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def test_build_container_with_target(self):
275275
pass
276276

277277
info = self.client.inspect_image('build1')
278-
assert not info['Config']['OnBuild']
278+
assert 'OnBuild' not in info['Config'] or not info['Config']['OnBuild']
279279

280280
@requires_api_version('1.25')
281281
def test_build_with_network_mode(self):

tests/ssh/api_build_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def test_build_container_with_target(self):
266266
pass
267267

268268
info = self.client.inspect_image('build1')
269-
assert not info['Config']['OnBuild']
269+
assert 'OnBuild' not in info['Config'] or not info['Config']['OnBuild']
270270

271271
@requires_api_version('1.25')
272272
def test_build_with_network_mode(self):

0 commit comments

Comments
 (0)