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>
This commit is contained in:
Sebastiaan van Stijn 2025-05-22 01:46:53 +02:00
parent db7f8b8bb6
commit e5c3eb18b6
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
2 changed files with 2 additions and 2 deletions

View File

@ -275,7 +275,7 @@ class BuildTest(BaseAPIIntegrationTest):
pass
info = self.client.inspect_image('build1')
assert not info['Config']['OnBuild']
assert 'OnBuild' not in info['Config'] or not info['Config']['OnBuild']
@requires_api_version('1.25')
def test_build_with_network_mode(self):

View File

@ -266,7 +266,7 @@ class BuildTest(BaseAPIIntegrationTest):
pass
info = self.client.inspect_image('build1')
assert not info['Config']['OnBuild']
assert 'OnBuild' not in info['Config'] or not info['Config']['OnBuild']
@requires_api_version('1.25')
def test_build_with_network_mode(self):