コード例 #1
0
    def test_usage_success_custom_message(self):
        info = 'Test'
        info_test = '! Execute: <python run.py input_file.xml> in order to run the game.\n! ' \
            'Error: %s' % info
        message = GameIOHandler.usage(info)

        self.assertEqual(message, info_test)
コード例 #2
0
    def test_usage_success_default_message(self):
        info = '! Execute: <python run.py input_file.xml> in order to run the game.\n! ' \
            'Error: The input XML file must be specified.'
        message = GameIOHandler.usage()

        self.assertEqual(message, info)
コード例 #3
0
ファイル: run.py プロジェクト: jezradek/life_game
def stop_with_error(error):
    """Stops the game with error status and message."""
    print GameIOHandler.usage(error.message)
    sys.exit(EXIT_FAILURE)