5 # Memory debug specific
8 uri
= libxml2
.parseURI("http://example.org:8088/foo/bar?query=simple#fragid")
9 if uri
.scheme() != 'http':
10 print "Error parsing URI: wrong scheme"
12 if uri
.server() != 'example.org':
13 print "Error parsing URI: wrong server"
15 if uri
.port() != 8088:
16 print "Error parsing URI: wrong port"
18 if uri
.path() != '/foo/bar':
19 print "Error parsing URI: wrong path"
21 if uri
.query() != 'query=simple':
22 print "Error parsing URI: wrong query"
24 if uri
.fragment() != 'fragid':
25 print "Error parsing URI: wrong query"
27 uri
.setScheme("https")
31 if result
!= "https://example.org:223/foo/bar?query=simple":
32 print "Error modifying or saving the URI"
35 # Memory debug specific
36 libxml2
.cleanupParser()
37 if libxml2
.debugMemory(1) == 0:
40 print "Memory leak %d bytes" % (libxml2
.debugMemory(1))