def test_intersection_void(self): set1 = PowerSet() set2 = PowerSet() set1.put('0') set1.put(':') set1.put('D') set2.put('1') set2.put('2') set2.put('3') data = sorted(set1.intersection(set2).list_value()) res = sorted([]) self.assertEqual(data, res)
def test_intersection_random(self): set1 = PowerSet() set1_list = [] set2 = PowerSet() set2_list = [] for i in range(1000): a = str(random.randint(0, 100000)) b = str(random.randint(0, 100000)) set1.put(a) set1_list.append(a) set2.put(b) set2_list.append(b) a = set(set1_list) b = set(set2_list) data = sorted(set1.intersection(set2).list_value()) res = sorted(list(a & b)) self.assertEqual(data, res)
def test_intersection_booth_void(self): set1 = PowerSet() set2 = PowerSet() data = sorted(set1.intersection(set2).list_value()) res = [] self.assertEqual(data, res)