Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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')
Beispiel #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')