Merge pull request #2549 from wpjunior/fix-plugin-feedback

Fix tests to support both log plugin feedbacks
This commit is contained in:
Ulysses Souza 2020-04-22 10:30:02 +02:00 committed by GitHub
commit 9a24df5cdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -273,11 +273,14 @@ class CreateContainerTest(BaseAPIIntegrationTest):
def test_invalid_log_driver_raises_exception(self):
log_config = docker.types.LogConfig(
type='asdf-nope',
type='asdf',
config={}
)
expected_msg = "logger: no log driver named 'asdf-nope' is registered"
expected_msgs = [
"logger: no log driver named 'asdf' is registered",
"looking up logging plugin asdf: plugin \"asdf\" not found",
]
with pytest.raises(docker.errors.APIError) as excinfo:
# raises an internal server error 500
container = self.client.create_container(
@ -287,7 +290,7 @@ class CreateContainerTest(BaseAPIIntegrationTest):
)
self.client.start(container)
assert excinfo.value.explanation == expected_msg
assert excinfo.value.explanation in expected_msgs
def test_valid_no_log_driver_specified(self):
log_config = docker.types.LogConfig(