コード例 #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())