Exemplo n.º 1
0
 def test_get_direction_assert_length_error(self):
     point_1 = (1, 0, 0)
     point_2 = (1, 1)
     with self.assertRaises(ValueError):
         picture_cross.get_direction(point_1, point_2)
     point_1 = (1, 1)
     point_2 = (1, 0, 0)
     with self.assertRaises(ValueError):
         picture_cross.get_direction(point_1, point_2)
Exemplo n.º 2
0
 def test_get_direction_diag(self):
     point_1 = (0, 0)
     point_2 = (1, 1)
     direction = picture_cross.get_direction(point_1, point_2)
     self.assertAlmostEqual(direction[0], 0.70710, places=4)
     self.assertAlmostEqual(direction[1], 0.70710, places=4)
Exemplo n.º 3
0
 def test_get_direction_y(self):
     point_1 = (0, 1)
     point_2 = (1, 1)
     direction = picture_cross.get_direction(point_1, point_2)
     self.assertSequenceEqual(list(direction), (1, 0))
Exemplo n.º 4
0
 def test_get_direction_basic(self):
     point_1 = (1.5, 3.1)
     point_2 = (3.3, 4.1)
     direction = picture_cross.get_direction(point_1, point_2)
     self.assertAlmostEqual(direction[1], 0.48564, places=4)
     self.assertAlmostEqual(direction[0], 0.87415, places=4)