def test_distance_all_2(self): p1 = point.Point(0.0, 0.0) p2 = point.Point(-3.0, 4.0) p3 = point.Point(5.0, -12.0) l1 = map.distance_all([p1, p2, p3]) l2 = [0.0, 5.0, 13.0] self.assertListAlmostEqual(l1, l2)
def test_distance_all2(self): pt_list = [point.Point(1, 0), point.Point(2, 0), point.Point(3, 3)] new_list = [1, 2, math.sqrt(18)] self.assertEqual(map.distance_all(pt_list), new_list)
def test_distance_all1(self): pt_list = [point.Point(1, 1), point.Point(2, 2)] new_list = [math.sqrt(2), math.sqrt(8)] self.assertEqual(map.distance_all(pt_list), new_list)
def test_6(self): t = [[-6, -7], [8, 9], [0, 2]] self.assertAlmostEqual(map.distance_all(t), [9.2, 12.0, 2])
def test_5(self): t = [[3, 4], [6, 7], [8, 9]] self.assertAlmostEqual(map.distance_all(t), [5, 9.2, 12.0])
def test_6(self): x = [[2, 2], [4, 3]] self.assertAlmostEqual(map.distance_all(x), [math.sqrt(8), 5]) # Add code here. pass
def test_5(self): x = [[0, 0], [1, 1]] self.assertAlmostEqual(map.distance_all(x), [0, math.sqrt(2)])
def test_distance_all_2(self): list = [point.Point(6, 8), point.Point(3, 4), point.Point(0, 8)] origin = point.Point(0, 0) expected = [10, 5, 8] self.assertEqual(map.distance_all(list, origin), expected)
def test_distance_all(self): list = [point.Point(6, 0), point.Point(3,0), point.Point(4, 0)] origin = point.Point(0, 0) expected = [6, 3, 4] self.assertEqual(map.distance_all(list, origin), expected)
def test_distance_all2(list): list = [(1,2),(3,4),(5,6),(20,30)] map.distance_all(list) list.__eq__([2.24,5,7.81,36.056])
def test_distance_all1(self): list=[(0,0),(0,1),(1,0)] map.distance_all(list) list.__eq__([0,1,1])