Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
anodos325 committed Dec 12, 2024
1 parent 59b3fd1 commit 34edd0f
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions tests/api2/test_rest_api_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,16 @@ def auth(request):
return request.param


def test_root_api_key_rest(auth):
"""We should be able to call a method with a root credential using REST API."""
with auth(["READONLY_ADMIN"]) as kwargs:
results = GET('/system/info/', **kwargs)
assert results.status_code == 200, results.text


def test_allowed_api_key_rest_plain(auth):
"""We should be able to request an endpoint with a credential that allows that request using REST API."""
with auth(["READONLY_ADMIN"]) as kwargs:
with auth(["FULL_ADMIN"]) as kwargs:
results = GET('/system/info/', **kwargs)
assert results.status_code == 200, results.text


def test_allowed_api_key_rest_dynamic(auth):
"""We should be able to request a dynamic endpoint with a credential that allows that request using REST API."""
with auth(["ACCOUNT_READ"]) as kwargs:
with auth(["FULL_ADMIN"]) as kwargs:
results = GET('/user/id/1/', **kwargs)
assert results.status_code == 200, results.text

Expand Down

0 comments on commit 34edd0f

Please sign in to comment.