Пример #1
0
   def testAddToBlock(self):
       c = Parser()
       
       block  = ['one', 'two', 'three']
      
       for line in self.lines:
           c.build_block(block, line) 
 
       self.assertEqual(block,['one', 'two', 'three', 'foo', 'bar'],block)
Пример #2
0
 def testEmphasisUnder(self):
     c = Parser()
     test = c.emphasis(self.marks[7])
     self.assertEqual(test,"<em>foo</em> bar <em>bam</em> <em>baz</em>", test)
Пример #3
0
 def testEmphasisAsk(self):
     c = Parser()
     test = c.emphasis(self.marks[6])
     self.assertEqual(test,"<em>foo</em> bam baz <em>bat</em> <em>bash</em>", test)
Пример #4
0
 def testConvertH6Hash(self):
     c = Parser()
     test = c.atx_headers(self.marks[5])
     self.assertEqual(test,"<h6> Sixth-level heading </h6>", 
                             "\nLine not converted correctly\nInput: %s\nOutput: %s" % 
                             (self.marks[5], test))
Пример #5
0
 def testConvertH3Hash(self):
     c = Parser()
     test = c.atx_headers(self.marks[2])
     self.assertEqual(test,"<h3> Third-level heading </h3>", 
                             "\nLine not converted correctly\nInput: %s\nOutput: %s" % 
                             (self.marks[2], test))
Пример #6
0
 def testConvertH1Hash(self):
     c = Parser()
     test = c.atx_headers(self.marks[0])
     self.assertEqual(test,"<h1> First-level heading </h1>", 
                             "\nLine not converted correctly\nInput: %s\nOutput: %s" % 
                             (self.marks[0], test))
Пример #7
0
 def testRemoveHash(self):
     c = Parser()
     test = c.strip_end(self.marks[0])
     self.assertEqual(test,"# First-level heading", "Line not stripped correctly")