def list_tests(context, id): j = base.get(context, RESOURCE, id=id).json()['job'] result = {'tests': []} result['tests'] += jobdefinition.get_tests( context, j['jobdefinition_id']).json()['tests'] result['tests'] += remoteci.get_tests( context, j['remoteci_id']).json()['tests'] return result
def get_full_data(context, id): # Get the job with embed on test and remoteci embed = 'jobdefinition,remoteci' job = base.get(context, RESOURCE, id=id, embed=embed).json()['job'] # Get the components of the job job_components = get_components(context, id).json()['components'] # Aggregate the data of each resource full_data = {'remoteci': job['remoteci'], 'jobdefinition': job['jobdefinition'], 'tests': [], 'components': []} for component in job_components: full_data['components'].append(component) return full_data
def get(context, id, **kwargs): return base.get(context, RESOURCE, id=id, **kwargs)
def get(context, id, where=None, embed=None): return base.get(context, RESOURCE, id=id, where=where, embed=embed)
def list_tests(context, id, **kwargs): j = base.get(context, RESOURCE, id=id, **kwargs).json()["job"] result = {"tests": []} result["tests"] += topic.list_tests(context, j["topic_id"]).json()["tests"] result["tests"] += remoteci.list_tests(context, j["remoteci_id"]).json()["tests"] return result
def list(context): return base.get(context, RESOURCE)