tests: имена стендов dev/test/prod вместо stand1/2/3
This commit is contained in:
+11
-11
@@ -343,9 +343,9 @@ t("POST /_mock/delay/-1 → 400", test_delay_negative)
|
|||||||
# ═══════════════════════════════════════
|
# ═══════════════════════════════════════
|
||||||
# 8. MULTI-STAND (v0.5.0+)
|
# 8. MULTI-STAND (v0.5.0+)
|
||||||
# ═══════════════════════════════════════
|
# ═══════════════════════════════════════
|
||||||
print("\n── 8. Multi-Stand (stand1/stand2/stand3) ──")
|
print("\n── 8. Multi-Stand (dev/test/prod) ──")
|
||||||
|
|
||||||
STANDS = ["stand1", "stand2", "stand3"]
|
STANDS = ["dev", "test", "prod"]
|
||||||
stand_instances = {}
|
stand_instances = {}
|
||||||
|
|
||||||
def test_stands_services():
|
def test_stands_services():
|
||||||
@@ -381,12 +381,12 @@ t("GET /openapi.json → 3 servers (по одному на стенд)", test_st
|
|||||||
|
|
||||||
def test_stands_fail_next_isolated():
|
def test_stands_fail_next_isolated():
|
||||||
"""fail-next на одном стенде не влияет на другой."""
|
"""fail-next на одном стенде не влияет на другой."""
|
||||||
requests.post(f"{BASE}/stand1/api/v1/svc/_mock/reset", headers=MH)
|
requests.post(f"{BASE}/dev/api/v1/svc/_mock/reset", headers=MH)
|
||||||
requests.post(f"{BASE}/stand2/api/v1/svc/_mock/reset", headers=MH)
|
requests.post(f"{BASE}/test/api/v1/svc/_mock/reset", headers=MH)
|
||||||
# fail-next только на stand1
|
# fail-next только на dev
|
||||||
requests.post(f"{BASE}/stand1/api/v1/svc/_mock/fail-next", headers=MH)
|
requests.post(f"{BASE}/dev/api/v1/svc/_mock/fail-next", headers=MH)
|
||||||
# Создаём операции на обоих стендах
|
# Создаём операции на обоих стендах
|
||||||
for sid, label in [("stand1", "fail"), ("stand2", "ok")]:
|
for sid, label in [("dev", "fail"), ("test", "ok")]:
|
||||||
r = requests.post(f"{BASE}/{sid}/api/v1/svc/instances",
|
r = requests.post(f"{BASE}/{sid}/api/v1/svc/instances",
|
||||||
json={"serviceId": 1, "displayName": label}, headers=H)
|
json={"serviceId": 1, "displayName": label}, headers=H)
|
||||||
inst_uid = js(r)["instanceUid"]
|
inst_uid = js(r)["instanceUid"]
|
||||||
@@ -394,11 +394,11 @@ def test_stands_fail_next_isolated():
|
|||||||
json={"instanceUid": inst_uid, "operation": "create", "svcOperationId": 18}, headers=H)
|
json={"instanceUid": inst_uid, "operation": "create", "svcOperationId": 18}, headers=H)
|
||||||
op_uid = js(r)["instanceOperationUid"]
|
op_uid = js(r)["instanceOperationUid"]
|
||||||
d = js(requests.post(f"{BASE}/{sid}/api/v1/svc/instanceOperations/{op_uid}/run", headers=H))
|
d = js(requests.post(f"{BASE}/{sid}/api/v1/svc/instanceOperations/{op_uid}/run", headers=H))
|
||||||
if sid == "stand1":
|
if sid == "dev":
|
||||||
assert d["ok"] is False, f"stand1 should fail, got ok={d['ok']}"
|
assert d["ok"] is False, f"dev should fail, got ok={d['ok']}"
|
||||||
else:
|
else:
|
||||||
assert d["ok"] is True, f"stand2 should succeed, got ok={d['ok']}"
|
assert d["ok"] is True, f"test should succeed, got ok={d['ok']}"
|
||||||
t("Изоляция fail-next: stand1 падает, stand2 работает", test_stands_fail_next_isolated)
|
t("Изоляция fail-next: dev падает, test работает", test_stands_fail_next_isolated)
|
||||||
|
|
||||||
|
|
||||||
# ═══════════════════════════════════════
|
# ═══════════════════════════════════════
|
||||||
|
|||||||
Reference in New Issue
Block a user