This commit is contained in:
2026-05-11 03:27:21 +03:30
parent cf7cbb937c
commit d0e68a1a56
854 changed files with 102985 additions and 76 deletions
+5 -20
View File
@@ -9,7 +9,7 @@ from utils.template import render
config = load_config()
BASE_URL = config["base_url"]
flow = config["flows"]["register_login"]
flow = config["flows"]["auth"]
redis_client = redis.Redis(
host="redis",
@@ -22,26 +22,9 @@ def test_auth_flow():
context = {}
context["random_username"] = f"user_{uuid.uuid4().hex[:6]}"
# -------- register --------
register = flow["register"]
body = render(register["body"], context)
res = http_request(
register["method"],
BASE_URL + register["path"],
json=body
)
assert res["status_code"] == register["expected_status"]
assert res["json"]["msg"] == register["expected_json"]["msg"]
# -------- login --------
login = flow["login"]
body = render(login["body"], context)
@@ -49,14 +32,16 @@ def test_auth_flow():
res = http_request(
login["method"],
BASE_URL + login["path"],
authenticated=False,
json=body
)
print(res)
assert res["status_code"] == login["expected_status"]
assert res["status"] == login["expected_status"]
token_field = login["extract"]["token"]
token = res["json"][token_field]
token = res["data"][token_field]
assert token is not None