Skip to content

Commit

Permalink
style(test): reorder methods
Browse files Browse the repository at this point in the history
  • Loading branch information
brucetony committed Apr 3, 2024
1 parent 965e682 commit 586ea6f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ def test_client():
yield test_client


@pytest.fixture(scope="package")
def test_token(test_client) -> BearerAuth:
"""Get a new access token from the IDP."""
test_user, test_pwd = "flameuser", "flamepwd"

resp = test_client.post("/token", data={"username": test_user, "password": test_pwd})
assert resp.status_code == httpx.codes.OK
token = resp.json()["access_token"]
return BearerAuth(token=token)


@pytest.fixture(scope="module")
def hub_token() -> BearerAuth:
"""Create an endpoint by which to test the valid JWKS."""
Expand All @@ -36,17 +47,6 @@ def hub_token() -> BearerAuth:
return BearerAuth(token)


@pytest.fixture(scope="package")
def test_token(test_client) -> BearerAuth:
"""Get a new access token from the IDP."""
test_user, test_pwd = "flameuser", "flamepwd"

resp = test_client.post("/token", data={"username": test_user, "password": test_pwd})
assert resp.status_code == httpx.codes.OK
token = resp.json()["access_token"]
return BearerAuth(token=token)


@pytest.fixture(scope="module")
def setup_kong(test_client, test_token):
"""Setup Kong instance with test data."""
Expand Down

0 comments on commit 586ea6f

Please sign in to comment.