added test for Player()
This commit is contained in:
28
tests/test_player.py
Normal file
28
tests/test_player.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import pytest
|
||||
|
||||
from pyjack.player import Player
|
||||
from pyjack.deck import Deck
|
||||
|
||||
|
||||
# Start Fixtures
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def player() -> Player:
|
||||
"""Fixture for the player test."""
|
||||
player = Player(0)
|
||||
return player
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def deck() -> Deck:
|
||||
deck = Deck()
|
||||
return deck
|
||||
|
||||
|
||||
# Start Tests:
|
||||
|
||||
|
||||
def test_player_hit_one_card(player, deck):
|
||||
player.hit(deck)
|
||||
assert len(player.hand.cards) == 1
|
||||
Reference in New Issue
Block a user