Skip to content

test(shape): cover move_vertex and translate mutation methods#2257

Merged
wkentaro merged 1 commit into
mainfrom
test/shape-mutation-methods
Jun 25, 2026
Merged

test(shape): cover move_vertex and translate mutation methods#2257
wkentaro merged 1 commit into
mainfrom
test/shape-mutation-methods

Conversation

@wkentaro

Copy link
Copy Markdown
Owner

Shape.insert_point and remove_point are unit-tested, but their sibling
mutation methods move_vertex (drag a vertex) and translate (drag a whole
shape) had no direct coverage despite being core editing primitives. These tests
close that gap: they pin sub-pixel float precision, assert move_vertex changes
only the target vertex, and assert translate shifts every point by the offset
without changing the point count.

Test plan

  • uv run pytest tests/unit/_shape_test.py -q (49 passed)
  • uv run ruff check / uv run ty check on the changed file

The sibling mutation methods insert_point and remove_point are unit-tested,
but move_vertex and translate (the drag-vertex and drag-shape primitives)
had no direct coverage. Add tests pinning sub-pixel float precision, that
move_vertex touches only the target vertex, and that translate shifts every
point by the offset without changing the point count.
@wkentaro wkentaro self-assigned this Jun 25, 2026
@wkentaro

Copy link
Copy Markdown
Owner Author

This was generated by AI during PR processing.

Verdict: recommend-merge

Test-only PR adding coverage for Shape.move_vertex and Shape.translate. Reviewed:

  • move_vertex(i=1, ...) correctly asserts only points[1] changes and the other three vertices are untouched.
  • translate(offset=...) correctly asserts all four vertices shift by the offset (verified arithmetic against the (0,0)-(10,10) square).
  • Both tests pass locally; names, kwargs, the _make_square_polygon helper, and pytest.approx usage match repo conventions.

CI is green across all 8 matrix jobs; branch is current with main (0 commits behind) and MERGEABLE. No findings.

@wkentaro wkentaro added the recommend-merge pr: Agent finalized and endorses it: review and merge label Jun 25, 2026
@wkentaro wkentaro added this to the v7.0.0 milestone Jun 25, 2026
@wkentaro wkentaro merged commit 093fd1e into main Jun 25, 2026
8 checks passed
@wkentaro wkentaro deleted the test/shape-mutation-methods branch June 25, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

recommend-merge pr: Agent finalized and endorses it: review and merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant