def test_get_project_details(): """ will return a array of project details from all projects with get_projects_details """ jp = JiraProxy(GOOD_VANILLA_SERVER_REG_USER_CONFIG) expected_project_lead = GOOD_VANILLA_SERVER_REG_USER_CONFIG['user'] details = jp.getProjectsDetails() assert details tst_details = [entry for entry in details if entry['Key'] == PROJECT_KEY_1] assert len(tst_details) > 0 assert tst_details[0]["Name"] == PROJECT_NAME_1 # assert tst_details[0]["Description"] == PROJECT_DESC_1 assert tst_details[0]["Details"]["lead"]["name"] == expected_project_lead
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_projects = jira.getProjects() except Exception as exc: problem = exc.args[0] print( f'Error while attempting to retrieve Jira project names: {problem}' ) sys.exit(2) for key in jira_projects: print(key) print("\n") try: jira_project_details = jira.getProjectsDetails() except Exception as exc: problem = exc.args[0] print( f'Error while attempting to retrieve Jira project details: {problem}' ) sys.exit(3) print(f'{"Key":<12} : {"Name":<30} : {"ID":<6}') print("-" * 60) for project in jira_project_details: key, name, details = [ project[attr] for attr in ['Key', 'Name', 'Details'] ] print(f'{key:<12} : {name:<30} : {details["id"]:>6}') print("\n")
def main(args): config = REG_USER_CONFIG config['logger'] = BasicLogger('11_gp.log') jira = JiraProxy(config) jira_proj = jira.getProjects() print(f'{"Key":<12} {"Name":<24}') print("-" * 40) for key, name in jira_proj.items(): print(f'{key:<12} {name:}') print("\n\n") jira_project_details = jira.getProjectsDetails() print(f'{"Key":<12} {"Name":<24} {"ID":<6}') print("-" * 60) for project in jira_project_details: print( f'{project["Key"]:<12} {project["Name"]:<24} {project["Details"]["id"]:<6}' )