auto: 2026-10-26 03:18 (ESD_LAPTOP)
This commit is contained in:
@@ -86,7 +86,12 @@ def client(tmp_path, monkeypatch):
|
||||
"routes": routes,
|
||||
},
|
||||
)
|
||||
project = {"road_type": "work", "design_speed_kph": None, "route_start_m": 1000.0}
|
||||
project = {
|
||||
"road_type": "work",
|
||||
"design_speed_kph": None,
|
||||
"route_start_m": 1000.0,
|
||||
"route_end_m": 2500.0,
|
||||
}
|
||||
|
||||
async def inputs(project_id, points=None):
|
||||
return tmp_path, project, router_mod._override(segments, points) if points else segments
|
||||
@@ -119,6 +124,7 @@ def test_get_chains_saved_choice(client) -> None:
|
||||
assert chain[1]["start_chainage_m"] == chain[0]["end_chainage_m"] == 1530.0
|
||||
assert chain[1]["end_chainage_m"] == 2170.0
|
||||
assert body["line"] == [[0, 0], [100, 200], [300, 400], [600, 500], [900, 400]]
|
||||
assert body["end_chainage_target_m"] == 2500.0 # 등록 목표 — 화면이 차이를 보임
|
||||
|
||||
|
||||
def test_put_saves_server_routes(client) -> None:
|
||||
|
||||
@@ -318,6 +318,10 @@ def test_fingerprint_update_and_revert():
|
||||
assert link.update_available(json.dumps(_route(moved)), linked) is False
|
||||
assert link.update_available(None, linked) is False # 지점 바뀌어 노선 빔 → 알림 없음
|
||||
assert link.update_available(_route(P2026), None) is False # 연결 안 함
|
||||
# 확정 풀림(D02 지점 바뀜 뒤 다시 [저장]만) → 가져오기 409 라 알리지 않음
|
||||
assert link.update_available(json.dumps(_route(moved)), linked, False) is False
|
||||
moved[1][0] += 0.5
|
||||
assert link.update_available(json.dumps(_route(moved)), linked, False) is False
|
||||
|
||||
|
||||
def test_assigned_list_flags_update(monkeypatch):
|
||||
@@ -333,6 +337,18 @@ def test_assigned_list_flags_update(monkeypatch):
|
||||
"linked_project_name": "임도",
|
||||
"source_fingerprint": linked,
|
||||
"route_json": json.dumps(_route(moved)),
|
||||
"confirmed_at": "2026-10-25 12:00:00",
|
||||
},
|
||||
{
|
||||
"assignee_id": 9,
|
||||
"project_id": PLAN_ID,
|
||||
"project_name": "시험",
|
||||
"year": 2028,
|
||||
"linked_project_id": ROAD_ID,
|
||||
"linked_project_name": "임도",
|
||||
"source_fingerprint": linked,
|
||||
"route_json": json.dumps(_route(moved)),
|
||||
"confirmed_at": None,
|
||||
},
|
||||
{
|
||||
"assignee_id": 8,
|
||||
@@ -343,12 +359,13 @@ def test_assigned_list_flags_update(monkeypatch):
|
||||
"linked_project_name": None,
|
||||
"source_fingerprint": None,
|
||||
"route_json": json.dumps(_route(P2027)),
|
||||
"confirmed_at": "2026-10-25 12:00:00",
|
||||
},
|
||||
]
|
||||
log = []
|
||||
monkeypatch.setattr(d01, "get_db_pool", lambda: FakeConn(log, rows))
|
||||
out = asyncio.run(d01.assigned_plan_routes(SESSION))["routes"]
|
||||
assert [r["update_available"] for r in out] == [True, False]
|
||||
assert [r["update_available"] for r in out] == [True, False, False]
|
||||
assert "route_json" not in out[0] and out[0]["assignee_id"] == 7
|
||||
assert "confirmed_at IS NOT NULL" in log[0][0]
|
||||
|
||||
@@ -361,6 +378,7 @@ def test_plan_source(monkeypatch):
|
||||
"assignee_id": 7,
|
||||
"year": 2026,
|
||||
"route_json": json.dumps(_route(P2026)),
|
||||
"confirmed_at": "2026-10-25 12:00:00",
|
||||
}
|
||||
|
||||
async def one(sql, args):
|
||||
@@ -371,6 +389,8 @@ def test_plan_source(monkeypatch):
|
||||
assert out["linked"] and out["update_available"] is False and out["year"] == 2026
|
||||
row["route_json"] = json.dumps(_route([[x, y + 2.0] for x, y in P2026]))
|
||||
assert asyncio.run(link.plan_source(ROAD_ID))["update_available"] is True
|
||||
row["confirmed_at"] = None # 확정 풀림 → 알림 없음
|
||||
assert asyncio.run(link.plan_source(ROAD_ID))["update_available"] is False
|
||||
|
||||
async def none(sql, args):
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user