Files
mtusi2026lab4/tests/expiry.py
T
2026-11-12 19:38:03 +03:00

18 lines
610 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""Отдельный стенд/запуск с SESSION_TTL_SECONDS=2, не обычный smoke."""
import time
from client import Client, arguments, run
def main():
args = arguments('Истечение короткой сессии')
c = Client(args.base_url, args.ca_file)
actor = c.user('expiry')
c.call('GET', '/api/v1/users/me', actor=actor, schema='User')
time.sleep(3)
c.call('GET', '/api/v1/users/me', 401, actor=actor)
print('PASS: действующая сессия стала 401 через 3 секунды при TTL=2')
if __name__ == '__main__':
run(main)