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)
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)
def stop_with_error(error): """Stops the game with error status and message.""" print GameIOHandler.usage(error.message) sys.exit(EXIT_FAILURE)