def test_get_dup_lst(self): dup_indexes = man.get_dup_lst(self.dup_src) # There should only be two equivalence classes self.assertEqual(len(dup_indexes), 2) # Assert the locations of each list test_1 = dup_indexes[0] test_2 = dup_indexes[1] if len(test_1) == 9: self.assertEqual(test_1, self.a_locations) else: self.assertEqual(test_1, self.b_locations) if len(test_2) == 9: self.assertEqual(test_2, self.a_locations) else: self.assertEqual(test_2, self.b_locations)
def test_get_dup_lst_with_prev_lst(self): # With a previous list, method should only check the indexes from the # previous list. Previous list represent the indexes of duplicates from # another column of the same table prev_lst = [self.a_locations, self.b_locations] exp_c_locs = [400, 500] exp_d_locs = [4500, 5000, 5500] dup_indexes = man.get_dup_lst(self.dup_src2, prev_lst) self.assertEqual(len(dup_indexes), 2) test_1 = dup_indexes[0] test_2 = dup_indexes[1] if len(test_1) == len(exp_c_locs): self.assertEqual(test_1, exp_c_locs) else: self.assertEqual(test_1, exp_d_locs) if len(test_2) == len(exp_c_locs): self.assertEqual(test_2, exp_c_locs) else: self.assertEqual(test_2, exp_d_locs)