Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RupinderKaurSSB committed Dec 3, 2024
1 parent a8e9443 commit d38b7f1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_guardian.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,16 @@ def test_get_guardian_token_failed_response() -> None:
assert "401" in str(exc_info.value)


def mock_fetch_personal_token():
fake_auto_token = "auto_fetched_token"
return fake_auto_token


@responses.activate
def test_call_api_without_keycloak_token(monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setenv("DAPLA_ENVIRONMENT", "TEST")
fake_auto_token = "auto_fetched_token"
fake_maskinporten_token = "maskinporten_access_token"

def mock_fetch_personal_token():
return fake_auto_token
fake_maskinporten_token = "maskinporten_access_token"

monkeypatch.setattr(
"dapla.AuthClient.fetch_personal_token", mock_fetch_personal_token
Expand Down

0 comments on commit d38b7f1

Please sign in to comment.