Merge remote-tracking branch 'origin/sub_laptop_2' into main_laptop_1
This commit is contained in:
@@ -75,10 +75,10 @@ def _patch_db(monkeypatch, project_root: Path, params: dict) -> None:
|
||||
monkeypatch.setattr(terrain_router, "get_surface_confirmation_params", confirmed)
|
||||
monkeypatch.setattr(terrain_router, "resolve_stored_project_path", lambda _s: project_root)
|
||||
|
||||
async def no_model(_connection, _project_id): # 격자 받을 자리(344-1)는 따로 시험
|
||||
async def no_model(_connection, _project_id, _params): # 격자 받을 자리(344-1)는 따로 시험
|
||||
return None
|
||||
|
||||
monkeypatch.setattr(terrain_router, "_confirmed_model", no_model)
|
||||
monkeypatch.setattr(terrain_router, "_design_model", no_model)
|
||||
|
||||
|
||||
PID = "1bb0f876-983f-4ca5-9cc7-f59ee1f77e0a"
|
||||
|
||||
@@ -141,3 +141,28 @@ def test_지반고_자릿수_기본_3_묶음은_6(tmp_path, monkeypatch):
|
||||
)
|
||||
assert plain["z"] == [round(5.5 * 0.1234567, 3)]
|
||||
assert fine["z"] == [round(5.5 * 0.1234567, 6)]
|
||||
|
||||
|
||||
def test_격자_모델은_params_파일_확정_행이_어긋나도(monkeypatch):
|
||||
"""578-1 — 확정 행(sheet)이 params(csf)와 어긋나도 서버 표본기와 같은 `dtm_{filter}.npz` 행을 고름."""
|
||||
rows = [
|
||||
(9, "dtm", "B04_PreProcess/models/dtm_sheet_laplace.npz"), # 확정(어긋남)
|
||||
(7, "dtm", "B04_PreProcess/models/dtm_csf.npz"),
|
||||
]
|
||||
|
||||
class _Cursor:
|
||||
async def execute(self, *_args):
|
||||
return None
|
||||
|
||||
async def fetchall(self):
|
||||
return rows
|
||||
|
||||
class _Connection:
|
||||
@asynccontextmanager
|
||||
async def cursor(self):
|
||||
yield _Cursor()
|
||||
|
||||
pick = asyncio.run(terrain_router._design_model(_Connection(), PID, PARAMS))
|
||||
assert pick == (7, "dtm", "B04_PreProcess/models/dtm_csf.npz")
|
||||
other = {**PARAMS, "source_filter": "pmf"}
|
||||
assert asyncio.run(terrain_router._design_model(_Connection(), PID, other)) is None
|
||||
|
||||
@@ -70,7 +70,7 @@ def sources(tmp_path: Path, monkeypatch: pytest.MonkeyPatch):
|
||||
monkeypatch.setattr(terrain, "get_db_pool", lambda: _Pool())
|
||||
monkeypatch.setattr(terrain, "get_project_storage_relative_path", _async("p"))
|
||||
monkeypatch.setattr(terrain, "get_surface_confirmation_params", _async(dict(LAS)))
|
||||
monkeypatch.setattr(terrain, "_confirmed_model", _async(None))
|
||||
monkeypatch.setattr(terrain, "_design_model", _async(None))
|
||||
monkeypatch.setattr(terrain, "resolve_stored_project_path", lambda stored: tmp_path)
|
||||
monkeypatch.setattr(terrain, "_design_grid", lambda *args: None)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user