Skip to content

Commit 79c4c38

Browse files
authored
Merge pull request #3165 from thaJeztah/tests_relax
tests/integration: update some tests for updated error-messages
2 parents 54ec0c6 + 5064995 commit 79c4c38

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/integration/api_container_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ def test_create_with_restart_policy(self):
122122
self.client.wait(id)
123123
with pytest.raises(docker.errors.APIError) as exc:
124124
self.client.remove_container(id)
125-
err = exc.value.explanation
126-
assert 'You cannot remove ' in err
125+
err = exc.value.explanation.lower()
126+
assert 'stop the container before' in err
127127
self.client.remove_container(id, force=True)
128128

129129
def test_create_container_with_volumes_from(self):

tests/integration/errors_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def test_api_error_parses_json(self):
99
self.client.start(container['Id'])
1010
with pytest.raises(APIError) as cm:
1111
self.client.remove_container(container['Id'])
12-
explanation = cm.value.explanation
13-
assert 'You cannot remove a running container' in explanation
12+
explanation = cm.value.explanation.lower()
13+
assert 'stop the container before' in explanation
1414
assert '{"message":' not in explanation
1515
self.client.remove_container(container['Id'], force=True)

0 commit comments

Comments
 (0)