Skip to content

Add test coverage for demo token validation in non-production mode#5

Merged
sunchuljung merged 4 commits intofeat/v0.3.1from
copilot/sub-pr-4
Feb 4, 2026
Merged

Add test coverage for demo token validation in non-production mode#5
sunchuljung merged 4 commits intofeat/v0.3.1from
copilot/sub-pr-4

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 4, 2026

The test suite verified that old tokens are rejected but didn't validate that demo tokens work through the same validation path when VAULT_TOKENS env var is not set.

Changes:

  • Added test_demo_tokens_work_when_env_var_not_set positioned after test_old_tokens_not_valid to validate the inverse case
  • Uses pytest.skipif to explicitly skip in production environments where VAULT_TOKENS is configured
@pytest.mark.skipif(
    os.getenv("VAULT_TOKENS") is not None,
    reason="Test only applies when VAULT_TOKENS env var is not set (demo mode)"
)
def test_demo_tokens_work_when_env_var_not_set(self):
    """Demo tokens should pass validation when VAULT_TOKENS env var is not set."""
    rate_limiter._requests.clear()
    validate_token(DEMO_TOKEN)
    validate_token(DEMO_ADMIN_TOKEN)

This ensures demo tokens flow through validate_token() successfully in local/test environments, complementing the existing test that verifies old hardcoded tokens are rejected.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits February 4, 2026 07:12
Co-authored-by: sunchuljung <108503957+sunchuljung@users.noreply.github.com>
Co-authored-by: sunchuljung <108503957+sunchuljung@users.noreply.github.com>
Co-authored-by: sunchuljung <108503957+sunchuljung@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on architecture updates for Rune plugin Add test coverage for demo token validation in non-production mode Feb 4, 2026
Copilot AI requested a review from sunchuljung February 4, 2026 07:15
@sunchuljung sunchuljung marked this pull request as ready for review February 4, 2026 07:18
@sunchuljung sunchuljung merged commit 562080b into feat/v0.3.1 Feb 4, 2026
@sunchuljung sunchuljung deleted the copilot/sub-pr-4 branch February 15, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants