示例#1
0
 def test_lxml(self):
     from calibre.utils.cleantext import test_clean_xml_chars
     test_clean_xml_chars()
     from lxml import etree
     raw = '<a/>'
     root = etree.fromstring(raw)
     self.assertEqual(etree.tostring(root), raw)
示例#2
0
 def test_lxml(self):
     from calibre.utils.cleantext import test_clean_xml_chars
     test_clean_xml_chars()
     from lxml import etree
     raw = '<a/>'
     root = etree.fromstring(raw)
     self.assertEqual(etree.tostring(root), raw)
示例#3
0
 def test_lxml(self):
     from calibre.utils.cleantext import test_clean_xml_chars
     test_clean_xml_chars()
     from lxml import etree
     raw = b'<a/>'
     root = etree.fromstring(raw, parser=etree.XMLParser(recover=True, no_network=True, resolve_entities=False))
     self.assertEqual(etree.tostring(root), raw)
示例#4
0
def test_lxml():
    from calibre.utils.cleantext import test_clean_xml_chars
    test_clean_xml_chars()
    from lxml import etree
    raw = '<a/>'
    root = etree.fromstring(raw)
    if etree.tostring(root) == raw:
        fprint('lxml OK!')
    else:
        raise RuntimeError('lxml failed')
示例#5
0
def test_lxml():
    from calibre.utils.cleantext import test_clean_xml_chars
    test_clean_xml_chars()
    from lxml import etree
    raw = '<a/>'
    root = etree.fromstring(raw)
    if etree.tostring(root) == raw:
        fprint('lxml OK!')
    else:
        raise RuntimeError('lxml failed')