def test_retrieving_jira_server_info(): """ will return a JiraServerInfo """ jp = JiraProxy(GOOD_VANILLA_SERVER_CONFIG) assert jp is not None assert jp.jira_version is not None info = jp.getServerInfo() #assert info.url == GOOD_VANILLA_SERVER_CONFIG['url'] assert re.search(r'^https?://\w+', info.url) assert re.search(r'^7\.([2-9])', info.version) or re.search(r'^8\.[0-3][0-9]?\.[0-9]+', info.version)
def main(args): jira = JiraProxy(REG_USER_CONFIG) if not jira: print( "Unable to obtain a JiraProxy instance for the given configuration" ) sys.exit(1) try: jira_info = jira.getServerInfo() print(f"Jira Server URL: {jira_info.url}") print(f"Jira Server Version: {jira_info.version}") except Exception as exc: problem = exc.args[0] print( f'Error while attempting to retrieve Jira server info: {problem}') sys.exit(2)