ЛР 2: PostgreSQL, Redis-сессии и проверки на оценку 4
Lab 2 application / application (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
2026-10-26 23:25:37 +03:00
parent 65003b6119
commit ef96551b7d
47 changed files with 1839 additions and 19 deletions
+14
View File
@@ -0,0 +1,14 @@
"""Use a separate API process with SESSION_TTL_SECONDS=2, sharing real stores."""
from pathlib import Path
import sys
import time
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / 'tests'))
from client import Client, check, timestamp
c = Client()
actor = c.user('expiry')
response = c.call('GET', '/api/v1/users/me', actor=actor, schema='User')
time.sleep(2.2)
c.call('GET', '/api/v1/users/me', 401, actor=actor)
print('PASS: session accepted before expiry; rejected after 2.2s with SESSION_TTL_SECONDS=2.')