Commit ac108329 authored by Łukasz Nowak's avatar Łukasz Nowak

Allow to test against real server.

parent 18a26c12
......@@ -160,13 +160,14 @@ class OnlineMixin:
def setUp(self):
self.host = "127.0.0.1"
self.port = 8080
self.tree = tempfile.mkdtemp()
self._start_nc()
self.url = 'http://%s:%s/' % (self.host, self.port)
self.shacache = os.environ.get('TEST_SHA_CACHE',
self.url + 'shacache')
self.shadir = os.environ.get('TEST_SHA_DIR',
self.url + 'shadir')
if not 'TEST_SHA_CACHE' in os.environ and not 'TEST_SHA_DIR' in os.environ:
self.tree = tempfile.mkdtemp()
self._start_nc()
self.test_data = tempfile.TemporaryFile()
self.test_string = str(random.random())
self.test_data.write(self.test_string)
......@@ -175,6 +176,7 @@ class OnlineMixin:
self.test_data.seek(0)
def tearDown(self):
if not 'TEST_SHA_CACHE' in os.environ and not 'TEST_SHA_DIR' in os.environ:
try:
httplib.HTTPConnection(self.host, self.port).request('KILL', '/')
except Exception:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment