def testCommandTest7 (self): factory = ParserFactory () factory.appendCommand (TestCommand) parser = factory.make (self.testPage, Application.config) text = u"""(: test Параметр1 Параметр2=2 Параметр3=3 :) Текст внутри команды (:testend:) (: test Параметры :) Контент (:testend:)""" result_right = u"""Command name: test params: Параметр1 Параметр2=2 Параметр3=3 content: Текст внутри команды Command name: test params: Параметры content: Контент""" result = parser.toHtml (text) self.assertEqual (result_right, result, result)
def testExceptionCommand (self): factory = ParserFactory () factory.appendCommand (ExceptionCommand) parser = factory.make (self.testPage, Application.config) text = u"""(:exception:)""" result = parser.toHtml(text) # Исключение не должно бросаться, а должно быть выведено в результирующий текст self.assertTrue ("Exception" in result, result)