def test_if_board_is_shown_properly_when_empty():
    board = [[], []]

    r = show_board(board)
    rows = r.split('\n')
    assert '(empty)' in rows[0]
    assert '-------' in rows[1]
    assert '(empty)' in rows[2]
def test_if_board_is_shown_properly_when_it_has_cards():
    path = os.path.join(CURRENT_PATH, 'fixtures', 'cards')
    cards = select_random_cards_from_set(path, 2)
    board = [cards, cards]

    r = show_board(board)
    rows = r.split('\n')
    assert cards[0]['meta']['name'] in rows[0]
    assert cards[1]['meta']['name'] in rows[1]
    assert '-------' in rows[2]
    assert cards[0]['meta']['name'] in rows[3]
    assert cards[1]['meta']['name'] in rows[4]
def display_match_state(title: str, state: dict, hero: dict, enemy: dict):
    # TODO: unittest
    click.echo(
        click.style(
            '============================================================',
            fg='green',
            bold=True))
    click.echo(click.style(f'{title}', fg='green', bold=True))
    click.echo(
        click.style(
            '============================================================',
            fg='green',
            bold=True))
    click.echo(
        click.style(f'ENEMY VALUE: ', fg='blue') +
        f'{state["enemy"]["value"]}')
    click.echo(click.style(f'ENEMY:', fg='blue') + f' - {display_boss(enemy)}')

    click.echo(click.style(f'BOARD:', fg='blue'))
    click.echo(show_board(state['board']))

    click.echo(click.style(f'YOU:', fg='blue') + f' - {display_hero(hero)}\n')
    click.echo(
        click.style(f'YOUR VALUE: ', fg='blue') + f'{state["hero"]["value"]}')
def test_if_show_board_raises_exception_if_board_has_wrong_length():
    board = [[]]

    r = show_board(board)
def test_if_show_board_raises_exception_if_board_is_none():
    board = None

    r = show_board(board)