summaryrefslogtreecommitdiff
path: root/debian/tests/python
diff options
context:
space:
mode:
Diffstat (limited to 'debian/tests/python')
-rw-r--r--debian/tests/python22
1 files changed, 22 insertions, 0 deletions
diff --git a/debian/tests/python b/debian/tests/python
new file mode 100644
index 0000000..5fa3338
--- /dev/null
+++ b/debian/tests/python
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+python <<EOF
+import libxml2
+import sys
+
+doc = libxml2.parseDoc(
+"""<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE test [
+<!ELEMENT test (#PCDATA) >
+<!ATTLIST test xmlns:abc CDATA #FIXED "http://abc.org" >
+<!ATTLIST test abc:attr CDATA #FIXED "def" >
+]>
+<test />
+""")
+elem = doc.getRootElement()
+attr = elem.hasNsProp('attr', 'http://abc.org')
+if attr == None or attr.serialize()[:-1] != """<!ATTLIST test abc:attr CDATA #FIXED "def">""":
+ print("Failed to find defaulted attribute abc:attr")
+ sys.exit(1)
+doc.freeDoc()
+EOF