Уточнил порядок аутентификации и подтвердил итоговые проверки

This commit is contained in:
2026-10-09 14:25:02 +03:00
parent 358ef4a046
commit 509161edca
6 changed files with 115 additions and 13 deletions
+4
View File
@@ -17,6 +17,10 @@ def main():
c.call('POST',path,400,actor=alice,body={'text':'hello','sender_id':bob['id']})
c.call('POST',path,400,actor=alice,body={'text':' '})
c.call('GET','/api/v1/chats/not-a-uuid',400,actor=alice)
# Сначала идентификация, затем валидация и доступ к ресурсу.
c.call('GET','/api/v1/chats/not-a-uuid',401)
c.call('POST',path,401,body={'text':''})
c.call('POST',path,400,actor=alice,raw=b'{',headers={'Content-Type':'application/json'})
c.call('POST',path,404,actor=eve,body={'text':'чужое'})
with concurrent.futures.ThreadPoolExecutor(max_workers=10) as pool:
sent=list(pool.map(lambda i: c.message(alice,chat,'Параллельное '+str(i))['json'],range(100)))