Beispiel #1
0
 def test_play_not_playable(self):
     player = Player()
     player.client = Mock()
     player.output_device = Mock()
     player.input_device = Mock(side_effect=[1, 0])
     player.current_middle = 'card_of_card'
     player.hand = ['card_of_card', 'not_of_not']
     data = {'action': 'play', 'middle': 'card_of_card'}
     player.play(data)
Beispiel #2
0
 def test_play(self):
     player = Player()
     player.client = Mock()
     player.output_device = Mock()
     player.input_device = Mock(return_value=0)
     player.current_middle = 'card_of_card'
     player.hand = ['card_of_card']
     data = {'action': 'play', 'middle': 'card_of_card'}
     player.play(data)
Beispiel #3
0
 def test_play_ace(self):
     player = Player()
     player.client = Mock()
     player.output_device = Mock()
     data = {'action': 'play', 'middle': 'ace_of_card'}
     player.play(data)
Beispiel #4
0
 def test_publish(self):
     player = Player()
     player.client = Mock()
     player.publish('action', 'middle')
     self.assertTrue(player.client.publish.called)