Добавить Compose-стенд и сценарии проверки сохранности

This commit is contained in:
Dima
2026-09-23 21:38:55 +03:00
parent c3840181f1
commit 08cb1cbfd4
5 changed files with 61 additions and 9 deletions
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env python3
"""Run against a test stack configured with SESSION_TTL_SECONDS=2."""
import time
from client import Client, arguments, check, run
def main():
args = arguments('Check that a short lived session expires')
client = Client(args.base_url, args.ca_file)
actor = client.user('expiry')
client.call('GET', '/api/v1/users/me', actor=actor, schema='User')
time.sleep(3)
client.call('GET', '/api/v1/users/me', 401, actor=actor)
print('PASS: expired Bearer token was rejected')
if __name__ == '__main__':
run(main)