Skip to content

Commit

Permalink
Merge pull request #3165 from thaJeztah/tests_relax
Browse files Browse the repository at this point in the history
tests/integration: update some tests for updated error-messages
  • Loading branch information
milas committed Aug 14, 2023
2 parents 54ec0c6 + 5064995 commit 79c4c38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/integration/api_container_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ def test_create_with_restart_policy(self):
self.client.wait(id)
with pytest.raises(docker.errors.APIError) as exc:
self.client.remove_container(id)
err = exc.value.explanation
assert 'You cannot remove ' in err
err = exc.value.explanation.lower()
assert 'stop the container before' in err
self.client.remove_container(id, force=True)

def test_create_container_with_volumes_from(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/errors_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def test_api_error_parses_json(self):
self.client.start(container['Id'])
with pytest.raises(APIError) as cm:
self.client.remove_container(container['Id'])
explanation = cm.value.explanation
assert 'You cannot remove a running container' in explanation
explanation = cm.value.explanation.lower()
assert 'stop the container before' in explanation
assert '{"message":' not in explanation
self.client.remove_container(container['Id'], force=True)

0 comments on commit 79c4c38

Please sign in to comment.