test: skip the test for markdown syntax if the module is not installed
This commit is contained in:
parent
80afa4ed37
commit
4bb50c59f7
1 changed files with 5 additions and 1 deletions
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
from sat.test import helpers
|
from sat.test import helpers
|
||||||
from sat.plugins import plugin_misc_text_syntaxes
|
from sat.plugins import plugin_misc_text_syntaxes
|
||||||
|
from twisted.trial.unittest import SkipTest
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -91,7 +92,10 @@ class SanitisationTest(helpers.SatTestCase):
|
||||||
By default lines are truncated after the 79th characters."""
|
By default lines are truncated after the 79th characters."""
|
||||||
source = "<img src=\"http://sat.goffi.org/static/images/screenshots/libervia/libervia_discussions.png\" alt=\"sat\"/>"
|
source = "<img src=\"http://sat.goffi.org/static/images/screenshots/libervia/libervia_discussions.png\" alt=\"sat\"/>"
|
||||||
expected = ""
|
expected = ""
|
||||||
d = self.text_syntaxes.convert(source, self.text_syntaxes.SYNTAX_XHTML, self.text_syntaxes.SYNTAX_MARKDOWN)
|
try:
|
||||||
|
d = self.text_syntaxes.convert(source, self.text_syntaxes.SYNTAX_XHTML, self.text_syntaxes.SYNTAX_MARKDOWN)
|
||||||
|
except plugin_misc_text_syntaxes.UnknownSyntax:
|
||||||
|
raise SkipTest("Markdown syntax is not available.")
|
||||||
d.addCallback(self.assertEqual, expected)
|
d.addCallback(self.assertEqual, expected)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue