Beispiel #1
0
 def test_bot_y(self):
     movable = m.Movable(c.Position(22.3, 34.5), 0.1, 0.03)
     self.assertEqual(35, movable.bot_y)
Beispiel #2
0
 def test_top_y(self):
     movable = m.Movable(c.Position(22.3, 34.5), 0.1, 0.03)
     self.assertEqual(34, movable.top_y)
Beispiel #3
0
 def test_right_x(self):
     movable = m.Movable(c.Position(22.3, 34.5), 0.1, 0.03)
     self.assertEqual(23, movable.right_x)
Beispiel #4
0
 def test_position(self):
     movable = m.Movable(c.Position(22.3, 34.5), 0.1, 0.03)
     self.assertEqual(c.Position(22.3, 34.5), movable.position)
     movable.position = c.Position(12.3, 14.5)
     self.assertEqual(c.Position(12.3, 14.5), movable.position)
     self.assertEqual(c.Position(12, 14), movable.rounded_pos)
Beispiel #5
0
 def test_points(self):
     movable = m.Movable(c.Position(22.3, 34.5), 0.1, 0.03)
     self.assertEqual(movable.points, 0)
     movable.add_points(5)
     self.assertEqual(movable.points, 5)
Beispiel #6
0
 def test_rounded_pos(self):
     movable = m.Movable(c.Position(22.3, 34.5), 0.1, 0.03)
     self.assertEqual(movable.rounded_pos.x, round(movable.x))
     self.assertEqual(movable.rounded_pos.y, round(movable.y))