-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
62e527d
commit dd913d7
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import pytest | ||
import requests | ||
|
||
from tests.tests_deployment import constants | ||
from tests.tests_deployment.utils import get_jupyterhub_token | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def api_token(): | ||
return get_jupyterhub_token("jupyterhub-api") | ||
|
||
|
||
@pytest.mark.filterwarnings("ignore::urllib3.exceptions.InsecureRequestWarning") | ||
def test_jupyterhub_loads_roles_from_keycloak(api_token): | ||
response = requests.get( | ||
f"https://{constants.NEBARI_HOSTNAME}/hub/api/user/{constants.KEYCLOAK_USERNAME}", | ||
headers={"Authorization": f"Bearer {api_token}"}, | ||
verify=False, | ||
) | ||
user = response.json() | ||
assert user["roles"] == [] |