Improving test coverage
Some checks are pending
benchmarks / benchmarks (macos-13, 3.12) (push) Waiting to run
benchmarks / benchmarks (macos-14, 3.12) (push) Waiting to run
benchmarks / benchmarks (ubuntu-latest, 3.12) (push) Waiting to run
benchmarks / benchmarks (windows-latest, 3.12) (push) Waiting to run
Upload coverage reports to Codecov / run (push) Waiting to run
pylint / lint (3.10) (push) Waiting to run
Run type checker / typecheck (3.10) (push) Waiting to run
Run type checker / typecheck (3.13) (push) Waiting to run
Wheel building and publishing / Build wheel on ubuntu-latest (push) Waiting to run
Wheel building and publishing / upload_pypi (push) Blocked by required conditions
tests / tests (macos-13, 3.10) (push) Waiting to run
tests / tests (macos-13, 3.13) (push) Waiting to run
tests / tests (macos-14, 3.10) (push) Waiting to run
tests / tests (macos-14, 3.13) (push) Waiting to run
tests / tests (ubuntu-latest, 3.10) (push) Waiting to run
tests / tests (ubuntu-latest, 3.13) (push) Waiting to run
tests / tests (windows-latest, 3.10) (push) Waiting to run
tests / tests (windows-latest, 3.13) (push) Waiting to run

This commit is contained in:
gumyr 2025-09-16 19:36:41 -04:00
parent bc8fd45625
commit 6f41cd851c
2 changed files with 52 additions and 17 deletions

View file

@ -122,6 +122,13 @@ def test_tan2_rad_arcs_4():
assert len(tan2_rad_edges) == 1
def test_tan2_rad_arcs_5():
"""no solution"""
with pytest.raises(RuntimeError) as excinfo:
Edge.make_constrained_arcs((0, 0), (10, 0), radius=2)
assert "Unable to find a tangent arc" in str(excinfo.value)
def test_tan2_center_on_1():
"""2 tangents & center on"""
c1 = PolarLine((0, 0), 4, -20, length_mode=LengthMode.HORIZONTAL)
@ -135,6 +142,35 @@ def test_tan2_center_on_1():
assert len(tan2_on_edge) == 1
def test_tan2_center_on_2():
"""2 tangents & center on"""
tan2_on_edge = Edge.make_constrained_arcs(
(0, 3), (5, 0), center_on=Line((0, -5), (0, 5))
)
assert len(tan2_on_edge) == 1
def test_tan2_center_on_3():
"""2 tangents & center on"""
tan2_on_edge = Edge.make_constrained_arcs(
Line((-5, 3), (5, 3)), (5, 0), center_on=Line((0, -5), (0, 5))
)
assert len(tan2_on_edge) == 1
def test_tan2_center_on_4():
"""2 tangents & center on"""
with pytest.raises(RuntimeError) as excinfo:
Edge.make_constrained_arcs(
Line((-5, 3), (5, 3)),
Line((-5, 0), (5, 0)),
center_on=Line((-5, -1), (5, -1)),
)
assert "Unable to find a tangent arc with center_on constraint" in str(
excinfo.value
)
def test_tan_center_on_1():
"""1 tangent & center on"""
c5 = PolarLine((0, 0), 4, 60)