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

Use pytest.raises context manager for aaiindex test. #2108

Merged
merged 4 commits into from
Mar 28, 2024
Merged
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
6 changes: 3 additions & 3 deletions galaxy_ng/tests/integration/api/test_aiindex.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
import requests

from ..utils import (
UIClient,
Expand Down Expand Up @@ -194,12 +195,11 @@ def test_namespace_add_list_remove_aiindex(ansible_config, namespace, pe_namespa
# 7. Repeat step 2 with a basic user
with UIClient(config=ansible_config("basic_user")) as uclient:
# 8. Assert permission error raises
assert (
with pytest.raises(requests.exceptions.HTTPError, match=r'.*403.*permission_denied.*'):
uclient.post(
"_ui/v1/ai_deny_index/namespace/",
payload={"reference": namespace}
).status_code == 403
)
)

with UIClient(config=ansible_config("partner_engineer")) as uclient:
# 9. add to the AI Index, a namespace owned by PE
Expand Down
Loading