From 32681edb477850f6a2dfccd1bc04bbf3ed0f7ab7 Mon Sep 17 00:00:00 2001 From: jan Date: Sat, 7 Mar 2026 00:48:22 -0800 Subject: [PATCH] [tests] fixup tests related to pather api changes --- masque/test/test_advanced_routing.py | 29 +++++++++------------------- masque/test/test_autotool.py | 4 ++-- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/masque/test/test_advanced_routing.py b/masque/test/test_advanced_routing.py index 5afcc21..7033159 100644 --- a/masque/test/test_advanced_routing.py +++ b/masque/test/test_advanced_routing.py @@ -18,23 +18,23 @@ def advanced_pather() -> tuple[Pather, PathTool, Library]: def test_path_into_straight(advanced_pather: tuple[Pather, PathTool, Library]) -> None: - p, tool, lib = advanced_pather + p, _tool, _lib = advanced_pather # Facing ports p.ports["src"] = Port((0, 0), 0, ptype="wire") # Facing East (into device) # Forward (+pi relative to port) is West (-x). # Put destination at (-20, 0) pointing East (pi). p.ports["dst"] = Port((-20, 0), pi, ptype="wire") - p.path_into("src", "dst") + p.trace_into("src", "dst") assert "src" not in p.ports assert "dst" not in p.ports - # Pather.path adds a Reference to the generated pattern + # Pather._traceL adds a Reference to the generated pattern assert len(p.pattern.refs) == 1 def test_path_into_bend(advanced_pather: tuple[Pather, PathTool, Library]) -> None: - p, tool, lib = advanced_pather + p, _tool, _lib = advanced_pather # Source at (0,0) rot 0 (facing East). Forward is West (-x). p.ports["src"] = Port((0, 0), 0, ptype="wire") # Destination at (-20, -20) rot pi (facing West). Forward is East (+x). @@ -43,7 +43,7 @@ def test_path_into_bend(advanced_pather: tuple[Pather, PathTool, Library]) -> No # Forward for South is North (+y). p.ports["dst"] = Port((-20, -20), 3 * pi / 2, ptype="wire") - p.path_into("src", "dst") + p.trace_into("src", "dst") assert "src" not in p.ports assert "dst" not in p.ports @@ -52,35 +52,24 @@ def test_path_into_bend(advanced_pather: tuple[Pather, PathTool, Library]) -> No def test_path_into_sbend(advanced_pather: tuple[Pather, PathTool, Library]) -> None: - p, tool, lib = advanced_pather + p, _tool, _lib = advanced_pather # Facing but offset ports p.ports["src"] = Port((0, 0), 0, ptype="wire") # Forward is West (-x) p.ports["dst"] = Port((-20, -10), pi, ptype="wire") # Facing East (rot pi) - p.path_into("src", "dst") - - assert "src" not in p.ports - assert "dst" not in p.ports - - -def test_path_from(advanced_pather: tuple[Pather, PathTool, Library]) -> None: - p, tool, lib = advanced_pather - p.ports["src"] = Port((0, 0), 0, ptype="wire") - p.ports["dst"] = Port((-20, 0), pi, ptype="wire") - - p.at("dst").path_from("src") + p.trace_into("src", "dst") assert "src" not in p.ports assert "dst" not in p.ports def test_path_into_thru(advanced_pather: tuple[Pather, PathTool, Library]) -> None: - p, tool, lib = advanced_pather + p, _tool, _lib = advanced_pather p.ports["src"] = Port((0, 0), 0, ptype="wire") p.ports["dst"] = Port((-20, 0), pi, ptype="wire") p.ports["other"] = Port((10, 10), 0) - p.path_into("src", "dst", thru="other") + p.trace_into("src", "dst", thru="other") assert "src" in p.ports assert_equal(p.ports["src"].offset, [10, 10]) diff --git a/masque/test/test_autotool.py b/masque/test/test_autotool.py index 5686193..e03994e 100644 --- a/masque/test/test_autotool.py +++ b/masque/test/test_autotool.py @@ -54,11 +54,11 @@ def autotool_setup() -> tuple[Pather, AutoTool, Library]: def test_autotool_transition(autotool_setup: tuple[Pather, AutoTool, Library]) -> None: - p, tool, lib = autotool_setup + p, _tool, _lib = autotool_setup # Route m1 from an m2 port. Should trigger via. # length 10. Via length is 1. So straight m1 should be 9. - p.path("start", ccw=None, length=10) + p.straight("start", 10) # Start at (0,0) rot pi (facing West). # Forward (+pi relative to port) is East (+x).