def test_compare_twice_nested_tuples_equal_should_be_equal(self):
     assert_that(
         eq_ignore_order([[(1, 2), (2, 3)], [(3, 4), (4, 5)]],
                         [[(3, 4), (4, 5)], [(2, 3), (1, 2)]]))
Пример #2
0
 def __eq__(self, other):
     return (id(self) == id(other) or super(Classifier, self).__eq__(other)
             and isinstance(other, Classifier)
             and eq_ignore_order(self.__properties, other.__properties)
             and eq_ignore_order(self.__operations, other.__operations))
 def test_compare_values_with_all_permutations_should_be_equal(self):
     values = [1, 2, 3]
     for p in permutations(values):
         assert_that(eq_ignore_order(values, p))
 def test_compare_nested_tuples_equal_should_be_equal(self):
     assert_that(eq_ignore_order([(1, 2), (3, 2)], [(3, 2), (1, 2)]))
 def test_compare_equal_should_be_equal(self):
     assert_that(eq_ignore_order([1, 2, 3], [1, 2, 3]))
 def test_compare_different_len_should_be_not_equal(self):
     assert_that(not eq_ignore_order([1, 2, 3], [1, 2]))
 def test_compare_empty_to_not_empty_should_be_not_equal(self):
     assert_that(not eq_ignore_order([], [1]))
     assert_that(not eq_ignore_order([1], []))
 def test_compare_empty_should_be_equal(self):
     assert_that(eq_ignore_order([], []))
 def __eq__(self, other):
     return (id(self) == id(other) or isinstance(other, Model)
             and eq_ignore_order(self.classifiers, other.classifiers))