def test_rotate(self): s1, s2 = Square("wheat", 0), Square("forest", 1) t = Tile(s1, s2) self.assertEqual(t.get_direction(), "right") t.rotate("clockwise") self.assertEqual(t.get_direction(), "down") t.rotate("counterclockwise") t.rotate("counterclockwise") self.assertEqual(t.get_direction(), "up") t.rotate("counterclockwise") self.assertEqual(t.get_direction(), "left")
def test_get(self): """Testing the get methods for Tile Class""" s1, s2 = Square("wheat", 0), Square("forest", 1) t = Tile(s1, s2) self.assertEqual(str(t.get_square2()), "0wheat") self.assertEqual(str(t.get_square1()), "1forest") self.assertEqual(t.square2.get_terrain(), "wheat") self.assertEqual(t.square1.get_terrain(), "forest") self.assertEqual(t.square2.get_crowns(), 0) self.assertEqual(t.square1.get_crowns(), 1) self.assertEqual(t.get_direction(), "right")