@@ -53,17 +53,15 @@ def test_api(self):
5353 """Using an empty query string (returns an XML exception)
5454 we are going to test if headers and body are returned correctly"""
5555 # Test as a whole
56- response = str (self .server .handleRequest ())
56+ header , body = [str (_v ) for _v in self .server .handleRequest ()]
57+ response = header + body
5758 expected = 'Content-Length: 206\n Content-Type: text/xml; charset=utf-8\n \n <ServiceExceptionReport version="1.3.0" xmlns="http://www.opengis.net/ogc">\n <ServiceException code="Service configuration error">Service unknown or unsupported</ServiceException>\n </ServiceExceptionReport>\n '
5859 self .assertEqual (response , expected )
59- # Test header
60- response = str (self .server .handleRequestGetHeaders ())
6160 expected = 'Content-Length: 206\n Content-Type: text/xml; charset=utf-8\n \n '
62- self .assertEqual (response , expected )
61+ self .assertEqual (header , expected )
6362 # Test body
64- response = str (self .server .handleRequestGetBody ())
6563 expected = '<ServiceExceptionReport version="1.3.0" xmlns="http://www.opengis.net/ogc">\n <ServiceException code="Service configuration error">Service unknown or unsupported</ServiceException>\n </ServiceExceptionReport>\n '
66- self .assertEqual (response , expected )
64+ self .assertEqual (body , expected )
6765
6866 def test_pluginfilters (self ):
6967 """Test python plugins filters"""
@@ -122,7 +120,8 @@ def responseComplete(self):
122120 self .assertTrue (filter2 in serverIface .filters ()[100 ])
123121 self .assertEqual (filter1 , serverIface .filters ()[101 ][0 ])
124122 self .assertEqual (filter2 , serverIface .filters ()[200 ][0 ])
125- response = str (self .server .handleRequest ('service=simple' ))
123+ header , body = [str (_v ) for _v in self .server .handleRequest ('service=simple' )]
124+ response = header + body
126125 expected = 'Content-type: text/plain\n \n Hello from SimpleServer!Hello from Filter1!Hello from Filter2!'
127126 self .assertEqual (response , expected )
128127
@@ -133,7 +132,8 @@ def responseComplete(self):
133132 self .assertTrue (filter2 in serverIface .filters ()[100 ])
134133 self .assertEqual (filter1 , serverIface .filters ()[101 ][0 ])
135134 self .assertEqual (filter2 , serverIface .filters ()[200 ][0 ])
136- response = str (self .server .handleRequest ('service=simple' ))
135+ header , body = [str (_v ) for _v in self .server .handleRequest ('service=simple' )]
136+ response = header + body
137137 expected = 'Content-type: text/plain\n \n Hello from SimpleServer!Hello from Filter1!Hello from Filter2!'
138138 self .assertEqual (response , expected )
139139
@@ -143,7 +143,8 @@ def wms_request_compare(self, request):
143143 assert os .path .exists (project ), "Project file not found: " + project
144144
145145 query_string = 'MAP=%s&SERVICE=WMS&VERSION=1.3&REQUEST=%s' % (urllib .quote (project ), request )
146- response = str (self .server .handleRequest (query_string ))
146+ header , body = [str (_v ) for _v in self .server .handleRequest (query_string )]
147+ response = header + body
147148 f = open (self .testdata_path + request .lower () + '.txt' )
148149 expected = f .read ()
149150 f .close ()
0 commit comments