コード例 #1
0
    def test_build_second_settlement_starting_resources_added_to_hand(self):
        player = Player()
        state = State(players=[player])
        hex = state.board.hexes[0]
        hex.resource_type = Rock

        assert state.player_hand[player].has(resource_type=Rock, count=0)

        state.build_second_settlement(player=player,
                                      vertex=state.board.vertices[0])

        assert state.player_hand[player].has(resource_type=Rock, count=1)
コード例 #2
0
    def test_build_second_settlement_building_exists(self):
        player = Player()
        state = State(players=[player])

        assert not state.board.vertices[0].building

        state.build_second_settlement(player=player,
                                      vertex=state.board.vertices[0])

        assert state.board.vertices[0].building
        assert isinstance(state.board.vertices[0].building, Settlement)
        assert state.board.vertices[0].building.player == player