示例#1
0
def test_it_is_not_allowed_to_add_null_card():
    player: Player = SimplePlayer("test")
    try:
        player.add_card(None)
        assert True is False
    except ValueError:
        assert True is True
示例#2
0
def test_player_has_name():
    player: Player = SimplePlayer("test")
    assert player.name == "test"
示例#3
0
def test_players_hand_is_empty():
    player: Player = SimplePlayer("test")
    assert len(player.show_cards()) == 0
示例#4
0
def test_players_hand_is_not_None():
    player: Player = SimplePlayer("test")
    assert player.show_cards() is not None
示例#5
0
def test_player_should_skip_take_more_before_17():
    player: Player = SimplePlayer("test")
    player.add_card(Card(15, "Test", "Test card"))
    assert player.make_turn(OnTurnEvent()) == Player.HIT_ME
示例#6
0
def test_player_should_skip_turn_after_17():
    player: Player = SimplePlayer("test")
    player.add_card(Card(17, "Test", "Test card"))
    assert player.make_turn(OnTurnEvent()) == Player.SKIP
示例#7
0
def __create_bots() -> MutableSet[Player]:
    bots = int(input("Please choose bot count: "))
    return set([SimplePlayer(f"Player_{i}") for i in range(bots)])