Skip to content

Commit 9b59e49

Browse files
wpjuniorulyssessouza
authored andcommitted
Fix tests to support both log plugin feedbacks
Signed-off-by: Wilson Júnior <[email protected]> Docker-DCO-1.1-Signed-off-by: Wilson Júnior <[email protected]> (github: wpjunior)
1 parent 913d129 commit 9b59e49

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/integration/api_container_test.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,14 @@ def test_valid_log_driver_and_log_opt(self):
273273

274274
def test_invalid_log_driver_raises_exception(self):
275275
log_config = docker.types.LogConfig(
276-
type='asdf-nope',
276+
type='asdf',
277277
config={}
278278
)
279279

280-
expected_msg = "logger: no log driver named 'asdf-nope' is registered"
280+
expected_msgs = [
281+
"logger: no log driver named 'asdf' is registered",
282+
"looking up logging plugin asdf: plugin \"asdf\" not found",
283+
]
281284
with pytest.raises(docker.errors.APIError) as excinfo:
282285
# raises an internal server error 500
283286
container = self.client.create_container(
@@ -287,7 +290,7 @@ def test_invalid_log_driver_raises_exception(self):
287290
)
288291
self.client.start(container)
289292

290-
assert excinfo.value.explanation == expected_msg
293+
assert excinfo.value.explanation in expected_msgs
291294

292295
def test_valid_no_log_driver_specified(self):
293296
log_config = docker.types.LogConfig(

0 commit comments

Comments
 (0)