summaryrefslogtreecommitdiff
path: root/indra/llmessage/tests/test_llsdmessage_peer.py
diff options
context:
space:
mode:
authorbrad kittenbrink <brad@lindenlab.com>2009-08-27 16:25:02 -0400
committerbrad kittenbrink <brad@lindenlab.com>2009-08-27 16:25:02 -0400
commitd020dae7b9c156a08d1dd17eade7f36011f4d0fe (patch)
tree67b1a28222116b20c5fa7bcc1cbd86ca47a91aa7 /indra/llmessage/tests/test_llsdmessage_peer.py
parent745845f79987e4b4ab7f5728746a0eda8898930f (diff)
parent70600ea66adc816e72e91e804deebde40ed6b1bc (diff)
Merged latest login-api with latest viewer-2.0.0-3 up through plugin-api-05 merge (r131929).
Some minor post-merge cleanups still required.
Diffstat (limited to 'indra/llmessage/tests/test_llsdmessage_peer.py')
-rw-r--r--indra/llmessage/tests/test_llsdmessage_peer.py30
1 files changed, 3 insertions, 27 deletions
diff --git a/indra/llmessage/tests/test_llsdmessage_peer.py b/indra/llmessage/tests/test_llsdmessage_peer.py
index e62f20912b..86d5761b1b 100644
--- a/indra/llmessage/tests/test_llsdmessage_peer.py
+++ b/indra/llmessage/tests/test_llsdmessage_peer.py
@@ -16,16 +16,12 @@ import os
import sys
from threading import Thread
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
+
mydir = os.path.dirname(__file__) # expected to be .../indra/llmessage/tests/
sys.path.insert(0, os.path.join(mydir, os.pardir, os.pardir, "lib", "python"))
from indra.util.fastest_elementtree import parse as xml_parse
from indra.base import llsd
-
-def debug(*args):
- sys.stdout.writelines(args)
- sys.stdout.flush()
-# comment out the line below to enable debug output
-debug = lambda *args: None
+from testrunner import run, debug
class TestHTTPRequestHandler(BaseHTTPRequestHandler):
"""This subclass of BaseHTTPRequestHandler is to receive and echo
@@ -106,25 +102,5 @@ class TestHTTPServer(Thread):
debug("Starting HTTP server...\n")
httpd.serve_forever()
-def main(*args):
- # Start HTTP server thread. Note that this and all other comm server
- # threads should be daemon threads: we'll let them run "forever,"
- # confident that the whole process will terminate when the main thread
- # terminates, which will be when the test executable child process
- # terminates.
- httpThread = TestHTTPServer(name="httpd")
- httpThread.setDaemon(True)
- httpThread.start()
- # choice of os.spawnv():
- # - [v vs. l] pass a list of args vs. individual arguments,
- # - [no p] don't use the PATH because we specifically want to invoke the
- # executable passed as our first arg,
- # - [no e] child should inherit this process's environment.
- debug("Running %s...\n" % (" ".join(args)))
- sys.stdout.flush()
- rc = os.spawnv(os.P_WAIT, args[0], args)
- debug("%s returned %s\n" % (args[0], rc))
- return rc
-
if __name__ == "__main__":
- sys.exit(main(*sys.argv[1:]))
+ sys.exit(run(server=TestHTTPServer(name="httpd"), *sys.argv[1:]))