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

integration: test_create_volume_invalid_driver allow either 400 or 404 #3296

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions tests/integration/api_volume_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ def test_create_volume(self):
assert result['Driver'] == 'local'

def test_create_volume_invalid_driver(self):
driver_name = 'invalid.driver'
# special name to avoid exponential timeout loop
# https://github.com/moby/moby/blob/9e00a63d65434cdedc444e79a2b33a7c202b10d8/pkg/plugins/client.go#L253-L254
driver_name = 'this-plugin-does-not-exist'

with pytest.raises(docker.errors.NotFound):
with pytest.raises(docker.errors.APIError) as cm:
self.client.create_volume('perfectcherryblossom', driver_name)
assert (
cm.value.response.status_code == 404 or
cm.value.response.status_code == 400
)

def test_list_volumes(self):
name = 'imperishablenight'
Expand Down