コード例 #1
0
    def test_response_is_returned(self):
        """
        For consistency across io adapters, the
        terminal adaper should return the output value. 
        """
        adapter = TerminalAdapter()
        statement = Statement("Come with me if you want to live.")

        self.assertEqual(
            adapter.process_response(statement),
            statement.text
        )
コード例 #2
0
    def test_response_is_returned(self):
        """
        For consistency across io adapters, the
        terminal adaper should return the output value. 
        """
        adapter = TerminalAdapter()
        statement = Statement("Come with me if you want to live.")

        self.assertEqual(
            adapter.process_response(statement),
            statement.text
        )
コード例 #3
0
class TerminalAdapterTests(TestCase):
    """
    The terminal adapter is designed to allow
    interaction with the chat bot to occur through
    a command line interface.
    """
    def setUp(self):
        self.adapter = TerminalAdapter()

    def test_response_is_returned(self):
        """
        For consistency across io adapters, the
        terminal adaper should return the output value. 
        """
        statement = Statement("Come with me if you want to live.")

        self.assertEqual(self.adapter.process_response(statement),
                         statement.text)
コード例 #4
0
    def test_response_is_returned(self):
        """
        For consistency across io adapters, the
        terminal adaper should return the output value. 
        """

        test_data = {
            "user": {
                "Come with me if you want to live.": {}
            },
            "bot": {
                "Fortunately for you, my process cannot be terminated.": {}
            }
        }

        adapter = TerminalAdapter()

        response = adapter.process_response(test_data)

        self.assertEqual(
            "Fortunately for you, my process cannot be terminated.", response)
コード例 #5
0
class TerminalAdapterTests(TestCase):
    """
    The terminal adapter is designed to allow
    interaction with the chat bot to occur through
    a command line interface.
    """

    def setUp(self):
        self.adapter = TerminalAdapter()

    def test_response_is_returned(self):
        """
        For consistency across io adapters, the
        terminal adaper should return the output value. 
        """
        statement = Statement("Come with me if you want to live.")

        self.assertEqual(
            self.adapter.process_response(statement),
            statement.text
        )
コード例 #6
0
    def test_response_is_returned(self):
        """
        For consistency across io adapters, the
        terminal adaper should return the output value. 
        """

        test_data = {
            "user": {
                "Come with me if you want to live.": {}
            },
            "bot": {
                "Fortunately for you, my process cannot be terminated.": {}
            }
        }

        adapter = TerminalAdapter()

        response = adapter.process_response(test_data)

        self.assertEqual(
            "Fortunately for you, my process cannot be terminated.",
            response
        )