Skip to content

Commit

Permalink
Use pytest.raises context manager for aaiindex test. (#2108)
Browse files Browse the repository at this point in the history
* Use pytest.raises context manager for aaiindex test.

No-Issue

Signed-off-by: James Tanner <tanner.jc@gmail.com>
  • Loading branch information
jctanner authored Mar 28, 2024
1 parent 65421b2 commit 430e7b2
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 430e7b2

Please sign in to comment.