fix: type checking in tests
CI / lint (pull_request) Successful in 2m49s
CI / test (3.11) (pull_request) Successful in 1m26s
CI / test (3.13) (pull_request) Successful in 2m7s
CI / test (3.12) (pull_request) Successful in 2m38s
CI / lint (push) Canceled after 13s
CI / test (3.11) (push) Canceled after 0s
CI / test (3.12) (push) Canceled after 0s
CI / test (3.13) (push) Canceled after 0s
Build and Publish / release (push) Successful in 14s
CI / lint (pull_request) Successful in 2m49s
CI / test (3.11) (pull_request) Successful in 1m26s
CI / test (3.13) (pull_request) Successful in 2m7s
CI / test (3.12) (pull_request) Successful in 2m38s
CI / lint (push) Canceled after 13s
CI / test (3.11) (push) Canceled after 0s
CI / test (3.12) (push) Canceled after 0s
CI / test (3.13) (push) Canceled after 0s
Build and Publish / release (push) Successful in 14s
This commit was merged in pull request #29.
This commit is contained in:
@@ -31,13 +31,14 @@ def _synthetic_scan(ny_n=20, nx_n=20):
|
||||
return {"file_prefix": "decision-test", "images": images}
|
||||
|
||||
|
||||
def test_decision_round_trips_without_pictures():
|
||||
th = Thresholds()
|
||||
def test_decision_round_trips_without_pictures(request):
|
||||
th = Thresholds.model_validate({})
|
||||
r = analyse(_synthetic_scan(), {"step_x_um": 10.0, "step_y_um": 10.0}, thresholds=th)
|
||||
assert r.found
|
||||
assert r.contour_cells, "the chosen 50 % blob must ship its cells"
|
||||
assert all(0 <= x < r.n_fast and 0 <= y < r.n_slow for x, y in r.contour_cells)
|
||||
# the centre lies within the contour's bounding box
|
||||
assert r.centre is not None
|
||||
xs = [x for x, _ in r.contour_cells]
|
||||
ys = [y for _, y in r.contour_cells]
|
||||
assert min(xs) - 1 <= r.centre.nx <= max(xs) + 1
|
||||
@@ -54,8 +55,9 @@ def test_decision_round_trips_without_pictures():
|
||||
assert "jpeg" not in wire["result"], "pictures never ride the JSON"
|
||||
assert wire["result"]["centre"]["image_number"] == r.centre.image_number
|
||||
assert wire["thresholds"]["object_union_spots"] is True
|
||||
|
||||
back = GridScanDecision.model_validate(wire)
|
||||
assert back.result.centre is not None
|
||||
assert back.result.contour_cells is not None
|
||||
assert back.result.centre.nx == r.centre.nx
|
||||
assert [tuple(c) for c in back.result.contour_cells] == r.contour_cells
|
||||
|
||||
|
||||
Reference in New Issue
Block a user