Esempio n. 1
0
 def test_move_negative_amount_doesnt_increase_position(self, x, y):
     starting_position = [125, 123]
     piece = PolygonPiece(Polygon([[0, 0], [3, 3], [0, 3]]),
                          starting_position.copy())
     piece.move(x, y)
     self.assertLessEqual(piece.get_position(), starting_position)
Esempio n. 2
0
 def test_move_zeroes_doesnt_change_position(self):
     starting_position = [125, 123]
     piece = PolygonPiece(Polygon([[0, 0], [3, 3], [0, 3]]),
                          starting_position.copy())
     piece.move(0, 0)
     self.assertEqual(starting_position, piece.get_position())
Esempio n. 3
0
 def test_get_position_returns_value_passed_in_construct(self):
     position = [12, 543]
     piece = PolygonPiece(Polygon([[0, 0], [0, 10], [10, 0], [10, 10]]),
                          position.copy())
     self.assertEqual(position, piece.get_position())