mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-11-12 15:03:55 +09:00
G3: session-scoped route_rules serves url_map checks without booting a second app (each boot re-exposes the plan-64 state-leak classes); test_fixture_scope_guard freezes the 13 remaining direct create_app callers as a shrinking baseline (config_checkpoint_alias migrated as proof). G4: assert_requires_auth/assert_admin_only promoted into tests/factories.py; test_raw_infra_authz delegates to the shared shape. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
24 lines
1.0 KiB
Python
24 lines
1.0 KiB
Python
"""§8 Phase B4 — /config-checkpoints aliases /snapshots.
|
|
|
|
"Config Checkpoint" is the user-facing name for a deployment config snapshot.
|
|
The snapshots blueprint serves every route under both /snapshots and
|
|
/config-checkpoints so the API matches the new wording while old callers keep
|
|
working.
|
|
"""
|
|
|
|
|
|
def test_config_checkpoints_resolves_same_handler(app, client, auth_headers):
|
|
# Both prefixes hit the same view, so a missing app produces the identical
|
|
# 404 response on either — proof the alias resolves to the same handler.
|
|
snaps = client.get('/api/v1/apps/999999/snapshots', headers=auth_headers)
|
|
ckpts = client.get('/api/v1/apps/999999/config-checkpoints', headers=auth_headers)
|
|
assert snaps.status_code == 404
|
|
assert ckpts.status_code == 404
|
|
assert ckpts.get_json() == snaps.get_json()
|
|
|
|
|
|
def test_both_route_spaces_registered(route_rules):
|
|
# route_rules is the session app's url_map (plan 77 G3) — no second boot.
|
|
assert any('/snapshots' in r for r in route_rules)
|
|
assert any('/config-checkpoints' in r for r in route_rules)
|