예제 #1
0
파일: test.py 프로젝트: Ju2ender/pymarked
    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)
예제 #2
0
 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 ')
예제 #3
0
 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)