Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests to support both log plugin feedbacks #2549

Merged
merged 1 commit into from
Apr 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions tests/integration/api_container_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,14 @@ def test_valid_log_driver_and_log_opt(self):

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(
Expand All @@ -287,7 +290,7 @@ def test_invalid_log_driver_raises_exception(self):
)
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(
Expand Down