class SpecificResponseAdapterTestCase(TestCase):
    """
    Test cases for the SpecificResponseAdapter
    """

    def setUp(self):
        super(SpecificResponseAdapterTestCase, self).setUp()
        self.adapter = SpecificResponseAdapter(
            input_text='Open sesame!',
            output_text='Your sesame seed hamburger roll is now open.'
        )

    def test_exact_match(self):
        """
        Test the case that an exact match is given.
        """
        statement = Statement('Open sesame!')
        confidence, match = self.adapter.process(statement)

        self.assertEqual(confidence, 1)
        self.assertEqual(match, self.adapter.response_statement)

    def test_not_exact_match(self):
        """
        Test the case that an exact match is not given.
        """
        statement = Statement('Open says me!')
        confidence, match = self.adapter.process(statement)

        self.assertEqual(confidence, 0)
        self.assertEqual(match, self.adapter.response_statement)
Esempio n. 2
0
class SpecificResponseAdapterTestCase(TestCase):
    """
    Test cases for the SpecificResponseAdapter
    """
    def setUp(self):
        super(SpecificResponseAdapterTestCase, self).setUp()
        self.adapter = SpecificResponseAdapter(
            input_text='Open sesame!',
            output_text='Your sesame seed hamburger roll is now open.')

    def test_exact_match(self):
        """
        Test the case that an exact match is given.
        """
        statement = Statement('Open sesame!')
        confidence, match = self.adapter.process(statement)

        self.assertEqual(confidence, 1)
        self.assertEqual(match, self.adapter.response_statement)

    def test_not_exact_match(self):
        """
        Test the case that an exact match is not given.
        """
        statement = Statement('Open says me!')
        confidence, match = self.adapter.process(statement)

        self.assertEqual(confidence, 0)
        self.assertEqual(match, self.adapter.response_statement)
Esempio n. 3
0
 def setUp(self):
     super(SpecificResponseAdapterTestCase, self).setUp()
     self.adapter = SpecificResponseAdapter(
         input_text='Open sesame!',
         output_text='Your sesame seed hamburger roll is now open.')
 def setUp(self):
     super(SpecificResponseAdapterTestCase, self).setUp()
     self.adapter = SpecificResponseAdapter(
         input_text='Open sesame!',
         output_text='Your sesame seed hamburger roll is now open.'
     )