"""{{ display_name }} MCP server — generated by mcpify. Do not hand-edit."""

from __future__ import annotations

from {{ module_name }}.auth.strategies.oauth2 import OAuth2Strategy, create_pkce_pair


def test_pkce_pair_produces_a_non_empty_verifier_and_challenge() -> None:
    verifier, challenge = create_pkce_pair()
    assert verifier
    assert challenge
    assert verifier != challenge


def test_validates_a_token_with_no_expiry_as_always_valid() -> None:
    strategy = OAuth2Strategy()
    assert strategy.validate_credentials({"access_token": "abc"})


def test_rejects_an_expired_token() -> None:
    strategy = OAuth2Strategy()
    assert not strategy.validate_credentials({"access_token": "abc", "expires_at": "1"})


def test_rejects_credentials_with_no_access_token() -> None:
    strategy = OAuth2Strategy()
    assert not strategy.validate_credentials({})
