kin: KIN-ARCH-007 Дочистить оставшиеся workaround path='' после KIN-ARCH-003
This commit is contained in:
parent
a28790d194
commit
e4566d51a6
3 changed files with 7 additions and 10 deletions
|
|
@ -1354,7 +1354,6 @@ def test_create_operations_project_with_ssh_fields(client):
|
|||
r = client.post("/api/projects", json={
|
||||
"id": "srv1",
|
||||
"name": "My Server",
|
||||
"path": "",
|
||||
"project_type": "operations",
|
||||
"ssh_host": "10.0.0.1",
|
||||
"ssh_user": "root",
|
||||
|
|
@ -1364,6 +1363,7 @@ def test_create_operations_project_with_ssh_fields(client):
|
|||
assert r.status_code == 200
|
||||
data = r.json()
|
||||
assert data["project_type"] == "operations"
|
||||
assert data["path"] is None
|
||||
assert data["ssh_host"] == "10.0.0.1"
|
||||
assert data["ssh_user"] == "root"
|
||||
assert data["ssh_key_path"] == "~/.ssh/id_rsa"
|
||||
|
|
@ -1397,7 +1397,6 @@ def test_create_operations_project_without_ssh_host_allowed(client):
|
|||
r = client.post("/api/projects", json={
|
||||
"id": "srv2",
|
||||
"name": "Server No SSH",
|
||||
"path": "",
|
||||
"project_type": "operations",
|
||||
})
|
||||
# Фикс KIN-ARCH-001: был 200, стал 422
|
||||
|
|
@ -1417,7 +1416,6 @@ def test_kin_arch_001_operations_without_ssh_host_returns_422(client):
|
|||
r = client.post("/api/projects", json={
|
||||
"id": "ops_no_ssh",
|
||||
"name": "Ops Without SSH",
|
||||
"path": "",
|
||||
"project_type": "operations",
|
||||
})
|
||||
assert r.status_code == 422
|
||||
|
|
@ -1429,7 +1427,6 @@ def test_kin_arch_001_operations_with_empty_ssh_host_returns_422(client):
|
|||
r = client.post("/api/projects", json={
|
||||
"id": "ops_empty_ssh",
|
||||
"name": "Ops Empty SSH",
|
||||
"path": "",
|
||||
"project_type": "operations",
|
||||
"ssh_host": "",
|
||||
})
|
||||
|
|
@ -1442,13 +1439,13 @@ def test_kin_arch_001_operations_with_valid_ssh_host_returns_200(client):
|
|||
r = client.post("/api/projects", json={
|
||||
"id": "ops_with_ssh",
|
||||
"name": "Ops With SSH",
|
||||
"path": "",
|
||||
"project_type": "operations",
|
||||
"ssh_host": "10.0.0.42",
|
||||
})
|
||||
assert r.status_code == 200
|
||||
data = r.json()
|
||||
assert data["project_type"] == "operations"
|
||||
assert data["path"] is None
|
||||
assert data["ssh_host"] == "10.0.0.42"
|
||||
|
||||
|
||||
|
|
@ -1484,7 +1481,6 @@ def test_kin_arch_001_422_error_message_mentions_ssh_host(client):
|
|||
r = client.post("/api/projects", json={
|
||||
"id": "ops_err_msg",
|
||||
"name": "Check Error Message",
|
||||
"path": "",
|
||||
"project_type": "operations",
|
||||
})
|
||||
assert r.status_code == 422
|
||||
|
|
|
|||
|
|
@ -84,10 +84,11 @@ def test_create_development_project_defaults(conn):
|
|||
|
||||
def test_update_project_ssh_fields(conn):
|
||||
"""KIN-071: update_project can set SSH fields."""
|
||||
models.create_project(conn, "srv2", "Server 2", "", project_type="operations")
|
||||
models.create_project(conn, "srv2", "Server 2", project_type="operations")
|
||||
updated = models.update_project(conn, "srv2", ssh_host="192.168.1.1", ssh_user="pelmen")
|
||||
assert updated["ssh_host"] == "192.168.1.1"
|
||||
assert updated["ssh_user"] == "pelmen"
|
||||
assert updated["path"] is None
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue