コード例 #1
0
ファイル: test_game_modes.py プロジェクト: heynemann/libmagic
def test_game_mode_validates_decks_for_repeated_cards():
    game_mode = GameMode()
    cards_a = [Card("Some card", Cost.empty())] * 5
    deck_a = Deck("deck a", cards_a)

    is_valid, message = game_mode.validate_deck(deck_a)
    assert not is_valid
    assert message == "There can be only 4 cards of type Card and name Some card in the deck and more than that was found."
コード例 #2
0
ファイル: test_game_modes.py プロジェクト: heynemann/libmagic
def test_game_mode_validate_ignores_repeated_lands():
    game_mode = GameMode()
    cards_a = [Land("Some land", "green")] * 20
    deck_a = Deck("deck a", cards_a)

    is_valid, message = game_mode.validate_deck(deck_a)
    assert is_valid
    assert not message
コード例 #3
0
ファイル: test_game_modes.py プロジェクト: heynemann/libmagic
def test_initialize_game_mode_keeps_track_of_game():
    game = Game()
    game_mode = GameMode()
    game_mode.initialize(game)
    assert game_mode.game is game