Beispiel #1
0
 def test__long__should_return_a_definition_list(self):
     hf1 = HTMLFormatter(self.record_list)
     doc = ElementTree.fromstring(hf1.long())
     self.assertEqual(doc.tag, 'dl')
     self.assertEqual(len(doc.findall("dt")), 2)
     self.assertEqual(len(doc.findall("dd")), 2)
     first_record = doc.find("dd")
     self.assertEqual(len(first_record.getchildren()), 1)
     self.assertEqual(first_record.getchildren()[0].tag, "dl")
Beispiel #2
0
 def test__long__should_return_a_definition_list(self):
     hf1 = HTMLFormatter(self.record_list)
     doc = ElementTree.fromstring(hf1.long())
     self.assertEqual(doc.tag, 'dl')
     self.assertEqual(len(doc.findall("dt")), 2)
     self.assertEqual(len(doc.findall("dd")), 2)
     first_record = doc.find("dd")
     self.assertEqual(len(first_record.getchildren()), 1)
     self.assertEqual(first_record.getchildren()[0].tag, "dl")
Beispiel #3
0
 def test__table__should_return_an_html_table(self):
     hf1 = HTMLFormatter(self.record_list)
     doc = ElementTree.fromstring(hf1.table())
     self.assertEqual(doc.tag, 'table')
     self.assertEqual(len(doc.findall("tr")), 3)
Beispiel #4
0
 def test__short__should_return_an_unordered_list(self):
     hf1 = HTMLFormatter(self.record_list)
     doc = ElementTree.fromstring(hf1.short())
     self.assertEqual(doc.tag, 'ul')
     self.assertEqual(len(doc.getchildren()), 2)
Beispiel #5
0
 def test__table__should_return_an_html_table(self):
     hf1 = HTMLFormatter(self.record_list)
     doc = ElementTree.fromstring(hf1.table())
     self.assertEqual(doc.tag, 'table')
     self.assertEqual(len(doc.findall("tr")), 3)
Beispiel #6
0
 def test__short__should_return_an_unordered_list(self):
     hf1 = HTMLFormatter(self.record_list)
     doc = ElementTree.fromstring(hf1.short())
     self.assertEqual(doc.tag, 'ul')
     self.assertEqual(len(doc.getchildren()), 2)