diff options
author | 2019-11-09 14:04:16 +0100 | |
---|---|---|
committer | 2019-11-09 14:43:34 +0100 | |
commit | 384308c4a5af0a66ff9e78de17ace94ab7d1d51f (patch) | |
tree | d257a651cd76a97317ab62cbb2a22096798d4904 /xtesting/core/testcase.py | |
parent | 66809ebba91d1f068c0a930dba695c3b02fc85bd (diff) |
Print Test API links in console
It adds TEST_DB_EXT_URL to print the right links in case of NAT or SSH
port forwardings.
Change-Id: If85b00de7325909facc903fba13a3fd59a1e705f
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'xtesting/core/testcase.py')
-rw-r--r-- | xtesting/core/testcase.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xtesting/core/testcase.py b/xtesting/core/testcase.py index cd0a9378..a385651f 100644 --- a/xtesting/core/testcase.py +++ b/xtesting/core/testcase.py @@ -232,8 +232,14 @@ class TestCase(): url, data=json.dumps(data, sort_keys=True), headers=self._headers) req.raise_for_status() - self.__logger.info( - "The results were successfully pushed to DB") + if urllib.parse.urlparse(url).scheme != "file": + res_url = req.json()["href"] + if env.get('TEST_DB_EXT_URL'): + res_url = res_url.replace( + env.get('TEST_DB_URL'), env.get('TEST_DB_EXT_URL')) + self.__logger.info( + "The results were successfully pushed to DB: \n\n%s\n", + res_url) except AssertionError: self.__logger.exception( "Please run test before publishing the results") |