예제 #1
0
 def test_str(self):
     raw = '<p class="first">A Text Element</p>'
     attr = HTMLAttribute(raw='class="first"',
                          start=3,
                          ident='class',
                          value='first')
     attrs = HTMLAttributes(raw='class="first"', start=3, attributes=[attr])
     open_tag = HTMLOpenTag(raw='<p class="first">',
                            tag='p',
                            attributes=attrs)
     close_tag = HTMLCloseTag(raw='</p>', start=31, tag='p')
     children = [HTMLInterval(raw='A Text Element', start=17)]
     element = HTMLElement(raw=raw,
                           open_tag=open_tag,
                           close_tag=close_tag,
                           children=children)
     self.assertEqual(raw, str(element))
예제 #2
0
 def test_to_text(self):
     interval = HTMLInterval(raw='Interval')
     self.assertEqual('', interval.to_text())
예제 #3
0
 def test_to_html(self):
     interval = HTMLInterval(raw='Interval')
     self.assertEqual('Interval', interval.to_html())
예제 #4
0
 def test_str(self):
     interval = HTMLInterval(raw='Interval')
     self.assertEqual('Interval', text_type(interval))
예제 #5
0
 def test_to_text(self):
     interval = HTMLInterval(raw='Interval')
     self.assertEqual('', interval.to_text())
예제 #6
0
 def test_to_html(self):
     interval = HTMLInterval(raw='Interval')
     self.assertEqual('Interval', interval.to_html())