Example #1
0
 def test_console_client_init(self):
     arguments = MockArgumentParser()
     client = ConsoleBotClient(arguments)
     self.assertIsNotNone(client)
     self.assertIsNotNone(client.arguments)
     self.assertEqual(client.id, "Console")
     self.assertEqual('ProgramY AIML2.0 Client', client.get_description())
Example #2
0
 def test_get_question(self):
     arguments = MockArgumentParser()
     client = ConsoleBotClient(arguments)
     self.assertIsNotNone(client)
     context = client.create_client_context("console")
     question = client.get_question(context, input_func=mock_input_func)
     self.assertEqual("Hello", question)
Example #3
0
 def test_console_client_init(self):
     arguments = MockArgumentParser()
     client = ConsoleBotClient(arguments)
     self.assertIsNotNone(client)
     self.assertIsNotNone(client.arguments)
     self.assertEqual(client.id, "Console")
     self.assertEqual('ProgramY AIML2.0 Console Client', client.get_description())
Example #4
0
 def test_get_question(self):
     arguments = MockArgumentParser()
     client = ConsoleBotClient(arguments)
     self.assertIsNotNone(client)
     context = client.create_client_context("console")
     question = client.get_question(context, input_func=mock_input_func)
     self.assertEquals("Hello", question)
Example #5
0
 def __init__(self, argument_parser=None):
     ConsoleBotClient.__init__(self, argument_parser)
     self.question = None
     self.response = ""
     self.get_question_exception = False
     self.process_question_answer_do_nothing = False
     self.process_question_answer_keyboard_interrupt = False
     self.process_question_answer_exception = False
Example #6
0
 def __init__(self, argument_parser=None):
     ConsoleBotClient.__init__(self, argument_parser)
     self.answer = None
     self.question = None
     self.response = ""
     self.get_question_exception = False
     self.process_question_answer_do_nothing = False
     self.process_question_answer_keyboard_interrupt = False
     self.process_question_answer_exception = False
Example #7
0
    def __init__(self, config_filename, logging_filename=None):
        self._config_filename = config_filename

        filepath = os.path.dirname(__file__) + os.sep
        if logging_filename is not None:
            self._logging_filename = logging_filename
        else:
            self._logging_filename = filepath + 'basicbot/logging.yaml'

        ConsoleBotClient.__init__(self, "Console")
Example #8
0
    def test_console_client_init(self):
        arguments = MockArgumentParser()
        client = ConsoleBotClient(arguments)
        self.assertIsNotNone(client)
        self.assertIsNotNone(client.arguments)
        self.assertEqual(client.id, "Console")
        self.assertEqual('ProgramY AIML2.0 Client', client.get_description())

        self.assertTrue(client._render_callback())
        self.assertIsInstance(client.renderer, TextRenderer)
Example #9
0
    def __init__(self, files={}, defaults=False, logging_filename=None):
        self._files = files
        self._defaults = defaults

        filepath = os.path.dirname(__file__) + os.sep
        if logging_filename is not None:
            self._logging_filename = logging_filename
        else:
            self._logging_filename = filepath + 'basicbot/logging.yaml'

        ConsoleBotClient.__init__(self, "Console")
Example #10
0
 def __init__(self, config_filename):
     self._config_filename = config_filename
     ConsoleBotClient.__init__(self, "Console")
Example #11
0
 def __init__(self, argument_parser=None):
     ConsoleBotClient.__init__(self, argument_parser)
Example #12
0
 def __init__(self, defaults_qandas, argument_parser=None):
     ConsoleBotClient.__init__(self, argument_parser)
     self._qandas = []
     self.load_qandas(defaults_qandas)
Example #13
0
 def __init__(self, argument_parser=None):
     ConsoleBotClient.__init__(self, argument_parser)