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

tests/integration: update some tests for updated error-messages #3165

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
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
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)