Пример #1
0
def test_player_receive_play():
    player = Player("name")
    card = Card("J", "c")
    player.receive_card(card)
    n.assert_equal(len(player), 1)
    n.assert_equal(player.play_card(), card)
    n.assert_equal(len(player), 0)
Пример #2
0
def test_player_receive_play():
    player = Player("name")
    card = Card("J", "c")
    player.receive_card(card)
    n.assert_equal(len(player), 1)
    n.assert_equal(player.play_card(), card)
    n.assert_equal(len(player), 0)
Пример #3
0
 def create_player(self, title):
     if self.human:
         msg = "Enter %s's name: " % title
         name = raw_input(msg) if sys.version_info[0] < 3 else input(msg)
     else:
         name = title
     return Player(name)
Пример #4
0
def test_player_init():
    player = Player("name")
    n.assert_equal(len(player), 0)
    n.assert_is_none(player.play_card())
Пример #5
0
 def create_player(self, title):
     if self.human:
         name = raw_input("Enter %s's name: " % title)
     else:
         name = title
     return Player(name)
Пример #6
0
def test_player_init():
    player = Player("name")
    n.assert_equal(len(player), 0)
    n.assert_is_none(player.play_card())
Пример #7
0
 def create_player(self, name):
     if self.human:
         name = input("Enter {}'s name:".format(name))
     return Player(name)