Fix tests to support both log plugin feedbacks

Signed-off-by: Wilson Júnior <wilsonpjunior@gmail.com>
Docker-DCO-1.1-Signed-off-by: Wilson Júnior <wilsonpjunior@gmail.com> (github: wpjunior)
This commit is contained in:
Wilson Júnior 2020-04-17 09:37:34 -03:00 committed by Ulysses Souza
parent 913d129dc9
commit 9b59e49113
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(