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)
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)
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)
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))
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))
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))
def testRemoveHash(self): c = Parser() test = c.strip_end(self.marks[0]) self.assertEqual(test,"# First-level heading", "Line not stripped correctly")