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 <[email protected]> Authored: Mon Dec 22 18:21:56 2014 -0800 Committer: Thomas Jackson <[email protected]> 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)
