def test_bot_y(self): movable = m.Movable(c.Position(22.3, 34.5), 0.1, 0.03) self.assertEqual(35, movable.bot_y)
def test_top_y(self): movable = m.Movable(c.Position(22.3, 34.5), 0.1, 0.03) self.assertEqual(34, movable.top_y)
def test_right_x(self): movable = m.Movable(c.Position(22.3, 34.5), 0.1, 0.03) self.assertEqual(23, movable.right_x)
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)
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)
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))