From: Kenneth Reitz Date: Sat, 15 Oct 2011 16:32:42 +0000 (-0400) Subject: Test suite cleanup X-Git-Tag: v0.6.5~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a0f3638b5fc8e196cfeebc4e506ea627d992483;p=services%2Fpython-requests.git Test suite cleanup --- diff --git a/test_requests.py b/test_requests.py index 51661df..ba9d27b 100755 --- a/test_requests.py +++ b/test_requests.py @@ -5,6 +5,7 @@ from __future__ import with_statement import time import cookielib +import os import unittest import envoy @@ -18,8 +19,9 @@ import requests from requests.sessions import Session +PORT = os.environ.get('HTTPBIN_PORT', '7045') -HTTPBIN_URL = 'http://0.0.0.0:7045/' +HTTPBIN_URL = 'http://0.0.0.0:%s/' % (PORT) # HTTPBIN_URL = 'http://127.0.0.1:8000/' @@ -45,7 +47,7 @@ class RequestsTestSuite(unittest.TestCase): if not _httpbin: - self.httpbin = envoy.connect('gunicorn httpbin:app --bind=0.0.0.0:7045') + self.httpbin = envoy.connect('gunicorn httpbin:app --bind=0.0.0.0:%s' % (PORT)) _httpbin = True time.sleep(1)