Beispiel #1
0
    def test_bad_statement(self):
        with self.assertRaises(ParsingError) as cm:
            convert_statement(LANGUAGES['en'], 'This is not a statement.')

        self.assertEquals(
            'Unkown statement format: "This is not a statement."',
            str(cm.exception))
    def test_bad_statement(self):
        with self.assertRaises(ParsingError) as cm:
            convert_statement('This is not a statement.')

        self.assertEquals(
            'Unkown statement format: "This is not a statement."',
            str(cm.exception))
Beispiel #3
0
 def assert_statement(self, expected_result, text):
     result = convert_statement(LANGUAGES['en'], text)
     self.assertEquals(
         expected_result, result,
         'Wrong result when converting statement:' +
         ' expected "%s", got "%s"' % (expected_result, result) +
         '\nStatement: "%s"' % text)
 def assert_statement(self, expected_result, text):
     result = convert_statement(text)
     self.assertEquals(
         expected_result, result,
         'Wrong result when converting statement:' +
         ' expected "%s", got "%s"' % (expected_result, result) +
         '\nStatement: "%s"' % text)