def runTest(self): text='''<<environ>> <</environ>>''' environ_value = 'ok' output = marked(text, environ=environ_value, macros=dict(environ=environ_macro)) self.assertEquals(output, environ_value)
def runTest(self): text = '''<<repeat count="2">> <<hello/>> tom <</repeat>>''' output = marked(text, macros=dict(repeat=repeat_macro), inline_macros=dict(hello=hello_macro)) self.assertEquals(output, 'Hello tom Hello tom ')
def assert_mk_equals(self, textpath, htmlpath): filename = basename(textpath) output = marked(self.read(textpath), **self.get_options(filename)) wanted = self.read(htmlpath) dir = basename(dirname(textpath)) if dir == 'basic': wanted = self.fix_pl(wanted) output = re.sub(r'\s', '', output) wanted = re.sub(r'\s', '', wanted) logging.debug([output]) logging.debug([wanted]) self.assertEqual(output, wanted, 'Failed %s' % filename)