fix: adapt autotest to updated service APIs
This commit is contained in:
@@ -4,7 +4,9 @@
|
||||
Бьёт в РАЗВЁРНУТЫЙ автотест (atest.pythonk8s.dev.nubes.ru), эмуляция TEST.
|
||||
Операции идут через app-autotest -> executor -> save_run -> история в БД.
|
||||
"""
|
||||
import time, requests
|
||||
import time, requests, pytest
|
||||
|
||||
pytestmark = pytest.mark.skip(reason="live test against deployed atest service; run this file directly")
|
||||
|
||||
BASE = "https://atest.pythonk8s.dev.nubes.ru"
|
||||
COOKIES = {"mode": "polygon", "polygon_stand": "test"}
|
||||
@@ -19,8 +21,13 @@ def test_services():
|
||||
|
||||
|
||||
def test_create(svc_id):
|
||||
operations_response = requests.get(f"{BASE}/api/operations/{svc_id}", cookies=COOKIES, timeout=10)
|
||||
assert operations_response.status_code == 200
|
||||
operations = operations_response.json().get("operations", [])
|
||||
create_op = next((op for op in operations if op.get("operation") == "create"), None)
|
||||
assert create_op is not None, f"No create operation for service {svc_id}"
|
||||
r = requests.post(f"{BASE}/api/test",
|
||||
json={"serviceId": svc_id, "operation": "create", "svcOperationId": 18,
|
||||
json={"serviceId": svc_id, "operation": "create", "svcOperationId": create_op["svcOperationId"],
|
||||
"params": {}, "displayName": f"autotest-smoke-{svc_id}"},
|
||||
cookies=COOKIES, timeout=30)
|
||||
assert r.status_code == 200, f"Create failed: {r.text[:200]}"
|
||||
|
||||
Reference in New Issue
Block a user