ЛР 3: балансировка, общая идемпотентность и исследование масштабирования
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Run only against a separate 2-second SESSION_TTL_SECONDS configuration."""
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import time
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / 'tests'))
|
||||
from client import Client
|
||||
|
||||
c = Client()
|
||||
user = c.user('expiry')
|
||||
c.call('GET', '/api/v1/users/me', actor=user, schema='User')
|
||||
time.sleep(2.2)
|
||||
c.call('GET', '/api/v1/users/me', 401, actor=user)
|
||||
print('PASS: session works before expiry and returns 401 after configured 2-second TTL.')
|
||||
Reference in New Issue
Block a user