コード例 #1
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')
コード例 #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')
コード例 #5
0
 def setUp(self):
     super(InputAdapterTestCase, self).setUp()
     self.adapter = InputAdapter()
コード例 #6
0
 def setUp(self):
     super(InputAdapterTestCase, self).setUp()
     self.adapter = InputAdapter()