You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2015/01/28 05:36:45 UTC
[07/50] trafficserver-qa git commit: Cleanup setUpEnv interface (pass
env)
Cleanup setUpEnv interface (pass env)
Project: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/commit/e0a0c9f0
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/tree/e0a0c9f0
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/diff/e0a0c9f0
Branch: refs/heads/master
Commit: e0a0c9f08cbfd53fb8e032c604606c61d14395eb
Parents: 103e70b
Author: Thomas Jackson <ja...@gmail.com>
Authored: Mon Dec 22 18:21:56 2014 -0800
Committer: Thomas Jackson <ja...@gmail.com>
Committed: Mon Dec 22 18:21:56 2014 -0800
----------------------------------------------------------------------
tsqa/test_cases.py | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver-qa/blob/e0a0c9f0/tsqa/test_cases.py
----------------------------------------------------------------------
diff --git a/tsqa/test_cases.py b/tsqa/test_cases.py
index 89ad203..ceff389 100644
--- a/tsqa/test_cases.py
+++ b/tsqa/test_cases.py
@@ -24,7 +24,7 @@ class EnvironmentCase(unittest.TestCase):
cls.environment = cls.getEnv()
# call env setup, so people can change configs etc
- cls.setUpEnv()
+ cls.setUpEnv(cls.environment)
# start ATS
cls.environment.start()
@@ -41,7 +41,7 @@ class EnvironmentCase(unittest.TestCase):
return ef.get_environment()
@classmethod
- def setUpEnv(cls):
+ def setUpEnv(cls, env):
'''
This funciton is responsible for setting up the environment for this fixture
This includes everything pre-daemon start
@@ -64,9 +64,6 @@ class DynamicHTTPEndpointCase(unittest.TestCase):
'''
@classmethod
def setUpClass(cls, port=0):
- # call parent constructor
- super(DynamicHTTPEndpointCase, cls).setUpClass()
-
cls.http_endpoint = tsqa.endpoint.DynamicHTTPEndpoint(port=port)
cls.http_endpoint.start()
@@ -75,10 +72,16 @@ class DynamicHTTPEndpointCase(unittest.TestCase):
# create local requester object
cls.track_requests = tsqa.endpoint.TrackingRequests(cls.http_endpoint)
+ # Do this last, so we can get our stuff registered
+ # call parent constructor
+ super(DynamicHTTPEndpointCase, cls).setUpClass()
+
def endpoint_url(self, path=''):
'''
Get the url for the local dynamic endpoint given a path
'''
+ if path and not path.startswith('/'):
+ path = '/' + path
return 'http://127.0.0.1:{0}{1}'.format(self.http_endpoint.address[1],
path)