import os
import io
import re
+import logging
from tidylib import tidy_document
import xml.etree.ElementTree as ET
import subprocess
from collections import OrderedDict
from nose.tools import * # for assert functions
+logger = logging.getLogger(__name__)
+
BASE_SERVER_ENV = {
'HTTP_HOST' : 'localhost',
'HTTP_USER_AGENT' : 'Mozilla/5.0 (X11; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0',
'%s.php' % endpoint)
env['NOMINATIM_SETTINGS'] = context.nominatim.local_settings_file
+ logger.debug("Environment:" + json.dumps(env, sort_keys=True, indent=2))
+
if hasattr(context, 'http_headers'):
env.update(context.http_headers)
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(outp, err) = proc.communicate()
+ outp = outp.decode('utf-8')
+
+ logger.debug("Result: \n===============================\n"
+ + outp + "\n===============================\n")
assert_equals(0, proc.returncode,
"query.php failed with message: %s\noutput: %s" % (err, outp))
assert_equals(0, len(err), "Unexpected PHP error: %s" % (err))
- outp = outp.decode('utf-8')
-
if outp.startswith('Status: '):
status = int(outp[8:11])
else: