diff options
Diffstat (limited to 'indra/llcorehttp/tests')
-rw-r--r-- | indra/llcorehttp/tests/test_llcorehttp_peer.py | 15 | ||||
-rw-r--r-- | indra/llcorehttp/tests/testrunner.py | 2 |
2 files changed, 12 insertions, 5 deletions
diff --git a/indra/llcorehttp/tests/test_llcorehttp_peer.py b/indra/llcorehttp/tests/test_llcorehttp_peer.py index aedd8acd83..0e38e5a87f 100644 --- a/indra/llcorehttp/tests/test_llcorehttp_peer.py +++ b/indra/llcorehttp/tests/test_llcorehttp_peer.py @@ -79,7 +79,10 @@ class TestHTTPRequestHandler(BaseHTTPRequestHandler): ## debug("root node tag %s", tree.getroot().tag) ## return llsd.to_python(tree.getroot()) - def do_GET(self): + def do_HEAD(self): + self.do_GET(withdata=False) + + def do_GET(self, withdata=True): # Of course, don't attempt to read data. self.answer(dict(reply="success", status=200, reason="Your GET operation worked")) @@ -96,20 +99,24 @@ class TestHTTPRequestHandler(BaseHTTPRequestHandler): self.answer(dict(reply="success", status=200, reason=self.read())) - def answer(self, data): + def answer(self, data, withdata=True): debug("%s.answer(%s): self.path = %r", self.__class__.__name__, data, self.path) if self.path.find("/sleep/") != -1: time.sleep(30) if "fail" not in self.path: - response = llsd.format_xml(data.get("reply", llsd.LLSD("success"))) + data = data.copy() # we're going to modify + # Ensure there's a "reply" key in data, even if there wasn't before + data["reply"] = data.get("reply", llsd.LLSD("success")) + response = llsd.format_xml(data) debug("success: %s", response) self.send_response(200) self.send_header("Content-type", "application/llsd+xml") self.send_header("Content-Length", str(len(response))) self.send_header("X-LL-Special", "Mememememe"); self.end_headers() - self.wfile.write(response) + if withdata: + self.wfile.write(response) else: # fail requested status = data.get("status", 500) # self.responses maps an int status to a (short, long) pair of diff --git a/indra/llcorehttp/tests/testrunner.py b/indra/llcorehttp/tests/testrunner.py index f2c841532a..5b9beb359b 100644 --- a/indra/llcorehttp/tests/testrunner.py +++ b/indra/llcorehttp/tests/testrunner.py @@ -35,7 +35,7 @@ import re import errno import socket -VERBOSE = os.environ.get("INTEGRATION_TEST_VERBOSE", "1") # default to verbose +VERBOSE = os.environ.get("INTEGRATION_TEST_VERBOSE", "0") # default to quiet # Support usage such as INTEGRATION_TEST_VERBOSE=off -- distressing to user if # that construct actually turns on verbosity... VERBOSE = not re.match(r"(0|off|false|quiet)$", VERBOSE, re.IGNORECASE) |