def test_10(self): points = [(-10, -10), (0, 0), (10, 10), (-10, 10), (10, -10), (5, 5), (-5, 5), (5, -5), (-5, -5), (6, 6)] self.assertEqual(closest_pair(points), [(5, 5), (6, 6)])
def test_3(self): points = [(0, 0), (10, 10), (11, 11)] self.assertEqual(closest_pair(points), [(10, 10), (11, 11)])
def check(points, min_d): return min_d == closest_pair(points)
def test_10(self): points = [(-10,-10), (0, 0), (10,10), (-10,10), (10,-10), (5,5), (-5,5), (5,-5), (-5,-5), (6,6)] self.assertEqual(closest_pair(points), [(5,5), (6,6)])
def test_3(self): points = [(0,0), (10, 10), (11,11)] self.assertEqual(closest_pair(points), [(10,10), (11,11)])
def test_closest_pair(self): closest_pairs = [(1, 1), (1, 2)] points = closest_pairs + [(3, 0), (4, 9)] result = closest_pair(points) self.assertEqual(result, tuple(closest_pairs))