forked from mtusi2026/mtusi2026lab2
17 lines
499 B
Python
17 lines
499 B
Python
"""Run on a dedicated API with SESSION_TTL_SECONDS=2."""
|
|
import sys
|
|
import time
|
|
from pathlib import Path
|
|
sys.path.insert(0,str(Path(__file__).resolve().parents[1]/'tests'))
|
|
from client import Client,run
|
|
|
|
def main():
|
|
c=Client()
|
|
user=c.user('expiry')
|
|
c.call('GET','/api/v1/users/me',actor=user,schema='User')
|
|
time.sleep(2.5)
|
|
c.call('GET','/api/v1/users/me',401,actor=user)
|
|
print('PASS: short session expires (expected configured TTL=2)')
|
|
if __name__=='__main__':
|
|
run(main)
|