File: test_entityreference.py

package info (click to toggle)
qm 1.1.3-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 8,628 kB
  • ctags: 10,249
  • sloc: python: 41,482; ansic: 20,611; xml: 12,837; sh: 485; makefile: 226
file content (38 lines) | stat: -rw-r--r-- 916 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
def test(tester):

    tester.startGroup('EntityReference')

    tester.startTest('Testing syntax')
    try:
        from xml.dom import EntityReference
        from xml.dom.EntityReference import EntityReference
    except:
        tester.error('Error in syntax',1)
    tester.testDone()


    tester.startTest('Creating test environment')
    from xml.dom import implementation
    dt = implementation.createDocumentType('','','')
    doc = implementation.createDocument('','ROOT',dt)

    entr = doc.createEntityReference("TestEntity")
    tester.testDone()

    tester.startTest('Test cloneNode()')
    entr1 = entr.cloneNode(1)
    if entr1.nodeName != entr.nodeName:
        tester.error("cloneNode failed")
    tester.testDone()


    return tester.groupDone()


if __name__ == '__main__':
    import sys
    import TestSuite

    tester = TestSuite.TestSuite()
    retVal = test(tester)
    sys.exit(retVal)