Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski committed May 4, 2024
1 parent 62e527d commit dd913d7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/tests_deployment/test_jupyterhub_api.py
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"] == []

0 comments on commit dd913d7

Please sign in to comment.