Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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')
Ejemplo n.º 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')