Skip to content

Commit

Permalink
add: test for two detectors are not equal
Browse files Browse the repository at this point in the history
  • Loading branch information
szsdk committed Mar 17, 2024
1 parent 3194e7e commit cb4c597
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions emcfile/tests/test_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,19 @@ def test_mask_functions(det):
det1 = deepcopy(det)
det1.mask_set(0b11, 0b01)
np.testing.assert_equal(det1.mask, ef.PixelType.CORNER)


def test_detector_not_equal(det):
"""
This tests covers the case where two detectors are not equal.
"""
a = det[: det.num_pix - 1]
assert a != det

a = deepcopy(det)
a.coor[0, 0] = -1000
assert a != det

a = deepcopy(det)
a.factor[0] = -1000
assert a != det

0 comments on commit cb4c597

Please sign in to comment.