From e5c3eb18b6faa5982d967d17ccb18acf44d7a9dc Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 22 May 2025 01:46:53 +0200 Subject: [PATCH] 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 --- tests/integration/api_build_test.py | 2 +- tests/ssh/api_build_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/api_build_test.py b/tests/integration/api_build_test.py index 62e93a73..0f560159 100644 --- a/tests/integration/api_build_test.py +++ b/tests/integration/api_build_test.py @@ -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): diff --git a/tests/ssh/api_build_test.py b/tests/ssh/api_build_test.py index 20476fc7..f17c7563 100644 --- a/tests/ssh/api_build_test.py +++ b/tests/ssh/api_build_test.py @@ -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):