Files
devplacepy/tests/api/serviceworkerjs.py
T
retoor 43f4011005 chore: reorganize test files into domain-specific subdirectories under tests/
Split the monolithic test directory into three tiers (unit, api, e2e) with a path-mirroring directory structure. Added corresponding Makefile targets (test-unit, test-api, test-e2e) and updated all documentation references (CLAUDE.md, README.md, testing-cicd.html, testing-framework.html, testing-make.html) to reflect the new layout and naming conventions.
2026-06-13 14:32:33 +00:00

26 lines
651 B
Python

# retoor <retoor@molodetz.nl>
import uuid
import requests
from tests.conftest import BASE_URL
def _session_push():
s = requests.Session()
name = f"push_{uuid.uuid4().hex[:10]}"
s.post(
f"{BASE_URL}/auth/signup",
data={
"username": name,
"email": f"{name}@test.dev",
"password": "secret123",
"confirm_password": "secret123",
},
allow_redirects=True,
)
return s
def test_service_worker_served(app_server):
r = requests.get(f"{BASE_URL}/service-worker.js")
assert r.status_code == 200
assert r.headers.get("Service-Worker-Allowed") == "/"