def test_where_is_tile(self): game = gametools.new_game() gametools.set_up_hotels(game) game["lonely_tiles"] = ["4C"] quantum = gametools.hotel_named(game, "quantum") quantum["tiles"] = ["8D", "9D"] self.assertEqual(gametools.where_is_tile(game, "1A"), None) self.assertEqual(gametools.where_is_tile(game, "4C"), "lonely") self.assertEqual(gametools.where_is_tile(game, "4D"), None) self.assertEqual(gametools.where_is_tile(game, "8D"), "quantum")
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)
def test_one_tile_added_to_hotel(self): tile = self.player["rack"][0] = "2D" gametools.play_tile(self.game, self.player, tile) self.assertEqual(len(self.phoenix["tiles"]), 3) self.assertEqual(gametools.where_is_tile(self.game, tile), "phoenix")