Merge remote-tracking branch 'origin/sub_laptop_1' into main_laptop_1
This commit is contained in:
@@ -115,6 +115,7 @@ out.noteInput = nudge.fitNote(ROUTE, after, 2, [], 20, 20);
|
||||
// 짝 — 서버 곡선표(파이썬이 씀)를 그대로 펴서 넣은 값이 돌아오는가
|
||||
const server = JSON.parse(fs.readFileSync(process.argv[2], "utf8"));
|
||||
const flat = edits.flattenServerPlan(server.nodes, server.curves, server.edits);
|
||||
out.nodeEdits = edits.nodeEdits(...server.editInput);
|
||||
out.flat = {
|
||||
planned: flat.planned,
|
||||
curveOn: flat.curveOn,
|
||||
|
||||
@@ -50,18 +50,21 @@ def saved(tmp_path_factory) -> dict:
|
||||
with replan._nodes_path(path).open(encoding="utf-8") as handle:
|
||||
nodes = [(float(row["x"]), float(row["y"])) for row in csv.DictReader(handle)]
|
||||
outline = build_planned_polyline(nodes, min_radius_m=30.0, simplify=False)
|
||||
edit_input = [NODES, FLAGS, RADII, LOCKS, ARCS]
|
||||
return {
|
||||
"path": path,
|
||||
"nodes": [node.as_dict() for node in outline.nodes],
|
||||
"curves": replan._read_curves(path),
|
||||
"edits": replan._read_curves(path, "edits"),
|
||||
"editInput": edit_input,
|
||||
"nodeEdits": node_edits(*edit_input),
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def got(saved, tmp_path_factory) -> dict:
|
||||
server = tmp_path_factory.mktemp("server") / "plan.json"
|
||||
payload = {key: saved[key] for key in ("nodes", "curves", "edits")}
|
||||
payload = {key: saved[key] for key in ("nodes", "curves", "edits", "editInput")}
|
||||
server.write_text(json.dumps(payload), encoding="utf-8")
|
||||
run = subprocess.run( # noqa: S603 — 고정 실행 파일
|
||||
["node", str(HELPER), str(server)],
|
||||
@@ -136,6 +139,10 @@ def test_node_edits_짧은_칸은_기본값() -> None:
|
||||
assert edits[2] == {"curve": True, "radius_m": None, "lock": None, "arc_m": None}
|
||||
|
||||
|
||||
def test_node_edits_TS_파이썬_같음(got, saved) -> None:
|
||||
assert got["nodeEdits"] == saved["nodeEdits"]
|
||||
|
||||
|
||||
def test_편집값_없이_쓴_곡선표는_edits_없음(tmp_path) -> None:
|
||||
path = tmp_path / "planned_route.csv"
|
||||
replan._write_planned_polyline(path, NODES, 30.0, simplify=False)
|
||||
|
||||
Reference in New Issue
Block a user