test(student-tests): lab2 consolidate negative, concurrency, auth and resilience checks in one commit
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user