This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
"""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)
|
||||
Reference in New Issue
Block a user