test(student-tests): lab2 consolidate negative, concurrency, auth and resilience checks in one commit

This commit is contained in:
Голиков Maximillian Антон
2026-10-02 16:32:10 +03:00
parent effb19289b
commit 9bba9c4b25
8 changed files with 337 additions and 7 deletions
+3 -2
View File
@@ -52,14 +52,15 @@ def main():
# --- гонка за username ---
username = 'race_' + uuid.uuid4().hex[:8]
password = 'T3st-' + uuid.uuid4().hex
body = {'username': username, 'display_name': 'Race', 'password': password}
barrier2 = threading.Barrier(workers)
def register(_):
local = Client(args.base_url, args.ca_file, timeout=10)
barrier2.wait()
try:
local.call('POST', '/api/v1/users', 201,
body={'username': username, 'display_name': 'Race'})
local.call('POST', '/api/v1/users', 201, body=body)
return 'ok'
except Failure:
return 'conflict'