Skip to content

Commit

Permalink
Add test for not implemented layers
Browse files Browse the repository at this point in the history
  • Loading branch information
jni committed Oct 30, 2023
1 parent 99eb2b7 commit e1a4cf5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/affinder/_tests/test_affinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,16 @@ def test_apply_affine():
res_layer = widget(ref_layer, mov_layer)

np.testing.assert_allclose(res_layer[0], ref_im)


def test_apply_affine_nonimage():
ref_im = np.random.random((5, 5))
mov_pts = np.random.random((5, 2))

ref_layer = napari.layers.Image(ref_im)
mov_layer = napari.layers.Points(mov_pts)
mov_layer.affine = np.array([[0.5, 0, 0], [0, 0.5, 0], [0, 0, 1]])

widget = apply_affine()
with pytest.raises(NotImplementedError):
widget(ref_layer, mov_layer)

0 comments on commit e1a4cf5

Please sign in to comment.