예제 #1
0
 def test_asserted_unsorted_notequal_list(self):
     """
     Tests that two hashables are correctly seen to not match
     """
     list_1 = [1, 2, 2, 3, 4, 4]
     list_2 = [1, 2, 3, 4]
     self.assertFalse(assert_unsorted_equal(list_1, list_2))
예제 #2
0
 def test_asserted_unsorted_notequal_list(self):
     """
     Tests that two hashables are correctly seen to not match
     """
     list_1 = [1, 2, 2, 3, 4, 4]
     list_2 = [1, 2, 3, 4]
     self.assertFalse(assert_unsorted_equal(list_1, list_2))
예제 #3
0
    def test_asserted_unsorted_equal_matches_equal_list(self):
        """
        Tests that two hashables are correclty matched when unordered
        """
        list_1 = [1, 2, 2, 3, 4, 4]
        list_2 = [2, 1, 4, 3, 2, 4]

        self.assertTrue(assert_unsorted_equal(list_1, list_2))
예제 #4
0
    def test_asserted_unsorted_equal_matches_equal_list(self):
        """
        Tests that two hashables are correclty matched when unordered
        """
        list_1 = [1, 2, 2, 3, 4, 4]
        list_2 = [2, 1, 4, 3, 2, 4]

        self.assertTrue(assert_unsorted_equal(list_1, list_2))
예제 #5
0
    def assertUnsortedNotEqual(self, hashable_1, hashable_2):
        """
        Wrapper function to make the tests easier to read. Wraps the utility
        function that compares if two hashables are equal or not.
        :param hashable_1: hashable value 1
        :param hashable_2: hashable value 2
        """

        if assert_unsorted_equal(hashable_1, hashable_2):
            raise Exception('Equal: arg1[{0}], arg2[{1}]'.format(
                hashable_1, hashable_2))
예제 #6
0
    def assertUnsortedNotEqual(self, hashable_1, hashable_2):
        """
        Wrapper function to make the tests easier to read. Wraps the utility
        function that compares if two hashables are equal or not.
        :param hashable_1: hashable value 1
        :param hashable_2: hashable value 2
        """

        if assert_unsorted_equal(hashable_1, hashable_2):
            raise Exception('Equal: arg1[{0}], arg2[{1}]'
                            .format(hashable_1, hashable_2))