Example #1
0
 def test_legit_play_tile(self):
     tile = None
     for rack_tile in self.player["rack"]:
         if rack_tile not in gametools.tiles_that_create_hotels(self.game):
             tile = rack_tile
             break
     gametools.play_tile(self.game, self.player, tile)
     self.assertTrue(tile in self.game["lonely_tiles"])
     self.assertTrue(tile not in self.player["rack"])
Example #2
0
 def test_tile_adjacent_to_lonely_tile_and_hotel(self):
     self.game["lonely_tiles"] = ["1A"]
     gametools.hotel_named(self.game, "sackson")["tiles"] = ["1C", "1D"]
     self.assertFalse("1B" in gametools.tiles_that_create_hotels(self.game))
Example #3
0
 def test_tiny_board(self):
     self.game["lonely_tiles"] = ["1A"]
     self.assertEqual(sorted(gametools.tiles_that_create_hotels(self.game), key=tile_order), ["1B", "2A"])
Example #4
0
 def test_tiles_that_create_hotels(self):
     self.game["lonely_tiles"] = ["1A", "8E", "8F", "9I"]
     self.assertEqual(
         sorted(gametools.tiles_that_create_hotels(self.game), key=tile_order),
         "1B 2A 7E 7F 8D 8G 8I 9E 9F 9H 10I".split(),
     )
Example #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)