Skip to content

Commit

Permalink
add: test for two pattern sets are not equal
Browse files Browse the repository at this point in the history
  • Loading branch information
szsdk committed Mar 17, 2024
1 parent 2f4919c commit 3194e7e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions emcfile/tests/test_patterns.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import copy
import gc
import itertools
import logging
Expand Down Expand Up @@ -88,6 +89,21 @@ def gen_pattern_inputs():
yield csr_matrix(dense), ref


def test_pattern_not_equal(small_data):
"""
This test covers different cases for the `__eq__` returns false.
"""
a = ef.patterns(gen_dense(small_data.num_data - 1, small_data.num_pix))
assert a != small_data

a = ef.patterns(gen_dense(small_data.num_data, small_data.num_pix - 1))
assert a != small_data

a = copy.deepcopy(small_data)
a.place_multi[0] = 9999999
assert a != small_data


@pytest.mark.parametrize("inp, ref", gen_pattern_inputs())
def test_patterns(inp, ref):
p = ef.patterns(inp)
Expand Down

0 comments on commit 3194e7e

Please sign in to comment.