def test_acquisative_opponent(self): """ Tests the get_opponent method mocking user's input for an acquisative opponent. """ deck_game = Game() with patch('__builtin__.raw_input', return_value='q'): self.assertFalse(deck_game.get_opponent())
def test_aggressive_opponent(self): """ Tests the get_opponent method mocking user's input. It gives an invalid input at first and a valid one for an aggressive opponent after that. """ deck_game = Game() with patch('__builtin__.raw_input', side_effect=['b', 'a']): self.assertTrue(deck_game.get_opponent())