class InputAdapterTestCase(ChatBotTestCase):
    """
    This test case is for the InputAdapter base class.
    Although this class is not intended for direct use,
    this test case ensures that exceptions requiring
    basic functionality are triggered when needed.
    """

    def setUp(self):
        super(InputAdapterTestCase, self).setUp()
        self.adapter = InputAdapter()

    def test_process_response(self):
        with self.assertRaises(InputAdapter.AdapterMethodNotImplementedError):
            self.adapter.process_input()

    def test_process_response_statement(self):
        with self.assertRaises(InputAdapter.AdapterMethodNotImplementedError):
            self.adapter.process_input_statement()

    def test_process_response_statement_initialized(self):
        self.adapter.context = self.chatbot
        self.adapter.process_input = lambda *args, **kwargs: Statement('Hi')
        response = self.adapter.process_input_statement()
        self.assertEqual(response, 'Hi')
예제 #2
0
class InputAdapterTestCase(TestCase):
    """
    This test case is for the InputAdapter base class.
    Although this class is not intended for direct use,
    this test case ensures that exceptions requiring
    basic functionality are triggered when needed.
    """
    def setUp(self):
        super(InputAdapterTestCase, self).setUp()
        self.adapter = InputAdapter()

    def test_process_response(self):
        with self.assertRaises(InputAdapter.AdapterMethodNotImplementedError):
            self.adapter.process_input()
예제 #3
0
class InputAdapterTestCase(TestCase):
    """
    This test case is for the InputAdapter base class.
    Although this class is not intended for direct use,
    this test case ensures that exceptions requiring
    basic functionality are triggered when needed.
    """

    def setUp(self):
        super(InputAdapterTestCase, self).setUp()
        self.adapter = InputAdapter()

    def test_process_response(self):
        with self.assertRaises(InputAdapter.AdapterMethodNotImplementedError):
            self.adapter.process_input()
예제 #4
0
class InputAdapterTestCase(ChatBotTestCase):
    """
    This test case is for the InputAdapter base class.
    Although this class is not intended for direct use,
    this test case ensures that exceptions requiring
    basic functionality are triggered when needed.
    """
    def setUp(self):
        super(InputAdapterTestCase, self).setUp()
        self.adapter = InputAdapter()

    def test_process_response(self):
        with self.assertRaises(InputAdapter.AdapterMethodNotImplementedError):
            self.adapter.process_input()

    def test_process_response_statement(self):
        with self.assertRaises(InputAdapter.AdapterMethodNotImplementedError):
            self.adapter.process_input_statement()

    def test_process_response_statement_initialized(self):
        self.adapter.context = self.chatbot
        self.adapter.process_input = lambda *args, **kwargs: Statement('Hi')
        response = self.adapter.process_input_statement()
        self.assertEqual(response, 'Hi')
 def setUp(self):
     super(InputAdapterTestCase, self).setUp()
     self.adapter = InputAdapter()
예제 #6
0
 def setUp(self):
     super(InputAdapterTestCase, self).setUp()
     self.adapter = InputAdapter()