コード例 #1
0
ファイル: tests.py プロジェクト: dtamez/mastermind-console
    def test_display_game_over_win(self, mock_raw_input):
        """Test that the right message is displayed on a win."""
        mm = MasterMind(4)
        mm.winner = True
        mm.save_score = MagicMock()

        mm.display_game_over()

        expected = [call('enter your initials:\n'),
                    call('Would you like to see the high scores? [y/N]\n'),
                    call().__eq__('y')]

        mock_raw_input.assert_called_with(expected)
コード例 #2
0
    def test_display_game_over_win(self, mock_raw_input):
        """Test that the right message is displayed on a win."""
        mm = MasterMind(4)
        mm.winner = True
        mm.save_score = MagicMock()

        mm.display_game_over()

        expected = [
            call('enter your initials:\n'),
            call('Would you like to see the high scores? [y/N]\n'),
            call().__eq__('y')
        ]

        mock_raw_input.assert_called_with(expected)