source: exist/branches/proglue_production_rev4605_xquery4884/python/elementtree-1.3a6-20070212-badc/unittests/test_entity.py @ 4886

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/exist/branches/proglue_production_rev4605_xquery4884/python/elementtree-1.3a6-20070212-badc/unittests/test_entity.py@4886
Revision 4886, 1.1 KB checked in by sdonegan, 10 years ago (diff)

Creating operational branch for ndgUtils as used on proglue

Line 
1# $Id: test_entity.py 3298 2007-09-13 14:38:02Z fredrik $
2
3from support import *
4
5ENTITY_XML = """\
6<!DOCTYPE points [
7<!ENTITY % user-entities SYSTEM 'user-entities.xml'>
8%user-entities;
9]>
10<document>&entity;</document>
11"""
12
13def entity():
14    """
15    Test entity handling.
16
17    1) bad entities
18
19    >>> ET.XML("<document>&entity;</document>")
20    Traceback (most recent call last):
21    ParseError: undefined entity: line 1, column 10
22
23    >>> ET.XML(ENTITY_XML)
24    Traceback (most recent call last):
25    ParseError: undefined entity &entity;: line 5, column 10
26
27    (add more tests here)
28
29    """
30
31def bug_xmltoolkit54():
32    """
33    problems handling internally defined entities
34
35    >>> e = ET.XML("<!DOCTYPE doc [<!ENTITY ldots '&#x8230;'>]><doc>&ldots;</doc>")
36    >>> serialize(e)
37    '<doc>&#33328;</doc>'
38    """
39
40def bug_xmltoolkit55():
41    """
42    make sure we're reporting the first error, not the last
43
44    >>> e = ET.XML("<!DOCTYPE doc SYSTEM 'doc.dtd'><doc>&ldots;&ndots;&rdots;</doc>")
45    Traceback (most recent call last):
46    ParseError: undefined entity &ldots;: line 1, column 36
47    """
Note: See TracBrowser for help on using the repository browser.