Exemplo n.º 1
0
 def test_turn_rotates_after_creating_hotel(self):
     self.game["lonely_tiles"] = ["1A"]
     tile = self.player["rack"][0] = "1B"
     gametools.play_tile(self.game, self.player, tile)
     gametools.create_hotel(self.game, self.player, self.zeta)
     gametools.purchase(self.game, self.player, {})
     self.assertEqual(gametools.active_player(self.game), self.game["players"][1])
Exemplo n.º 2
0
 def test_many_tiles_added_to_hotel(self):
     for tile in ["2D", "1B", "1A", "2A"]:
         player = gametools.active_player(self.game)
         player["rack"][0] = tile
         gametools.play_tile(self.game, player, tile)
         gametools.purchase(self.game, player, {})
         self.assertEqual(gametools.where_is_tile(self.game, tile), "phoenix")
     self.assertEqual(len(self.phoenix["tiles"]), 6)
Exemplo n.º 3
0
 def setUp(self):
     self.game = gametools.new_game()
     gametools.add_player_named(self.game, "testwomanican")
     gametools.add_player_named(self.game, "testmanican")
     gametools.add_player_named(self.game, "testvetica")
     self.starting_tiles = gametools.start_game(self.game)
     self.player = gametools.active_player(self.game)
     for hotel in self.game["hotels"]:
         setattr(self, hotel["name"], hotel)
Exemplo n.º 4
0
 def test_turn_rotates_after_playing_tile(self):
     gametools.play_tile(self.game, self.player, self.player["rack"][0])
     self.assertEqual(gametools.active_player(self.game), gametools.player_after(self.game, self.player))
Exemplo n.º 5
0
 def force_active_player_to_create_hotel(self):
     tile_to_play = gametools.tiles_that_create_hotels(self.game)[0]
     player = gametools.active_player(self.game)
     player["rack"][0] = tile_to_play
     gametools.play_tile(self.game, player, tile_to_play)