示例#1
0
 def test_icase_href(self):
     for x in ('HREF', 'Href', 'hreF', 'href'):
         self.assertEqual(R.html2vtml('<a %s="link.here">foo</a>' % x),
                          self.a_format % 'foo (link.here)', x)
         self.assertEqual(R.html2vtml('<A %s="link.here">foo</a>' % x),
                          self.a_format % 'foo (link.here)')
         self.assertEqual(R.html2vtml('<A %s="link.here">foo</A>' % x),
                          self.a_format % 'foo (link.here)')
         self.assertEqual(R.html2vtml('<a %s="link.here">foo</A>' % x),
                          self.a_format % 'foo (link.here)')
示例#2
0
 def test_unquoted_href(self):
     self.assertEqual(R.html2vtml('<a href=link.here>foo</a>'),
                      self.a_format % 'foo (link.here)')
示例#3
0
 def test_quoted_href(self):
     self.assertEqual(R.html2vtml('<a href="link.here">foo</a>'),
                      self.a_format % 'foo (link.here)')
     self.assertEqual(R.html2vtml("<a href='link.here'>foo</a>"),
                      self.a_format % 'foo (link.here)')
示例#4
0
 def test_empty_href(self):
     self.assertEqual(R.html2vtml('<a href>foo</a>'), self.a_format % 'foo')
示例#5
0
 def test_a_tag_no_href(self):
     self.assertEqual(R.html2vtml('<a>foo</a>'), self.a_format % 'foo')
示例#6
0
 def test_strip(self):
     self.assertEqual(R.html2vtml('<script>nope</script>'), '')
     self.assertEqual(R.html2vtml('before<script>nope</script>after'),
                      'beforeafter')
示例#7
0
 def test_noop(self):
     self.assertEqual(R.html2vtml('<script>nope</script>'), '')
示例#8
0
 def test_parity(self):
     for tag in ('b', 'u'):
         markup = '<%s>stuff</%s>' % (tag, tag)
         self.assertEqual(R.html2vtml(markup), markup)