diff --git a/tests/webapp/api/test_resultset_api.py b/tests/webapp/api/test_resultset_api.py index b961a40a3..fa4c834a2 100644 --- a/tests/webapp/api/test_resultset_api.py +++ b/tests/webapp/api/test_resultset_api.py @@ -47,8 +47,8 @@ def test_resultset_list_bad_project(webapp, jm): assert resp.json == {"message": "No project with name foo"} -def test_resultset_list_no_jobs_no_results(webapp, initial_data, - pushlog_sample, jm): +def test_resultset_list_exclude_empty_no_rs(webapp, initial_data, + pushlog_sample, jm): """ test retrieving a resultset list, when the resultset has no jobs. should not show. @@ -58,13 +58,30 @@ def test_resultset_list_no_jobs_no_results(webapp, initial_data, pushlog_sample['revisions']) resp = webapp.get( - reverse("resultset-list", - kwargs={"project": jm.project}) + reverse("resultset-list", kwargs={"project": jm.project}), + {"exclude_empty": 1}, ) assert resp.status_int == 200 assert len(resp.json) == 0 +def test_resultset_list_empty_rs_still_show(webapp, initial_data, + pushlog_sample, jm): + """ + test retrieving a resultset list, when the resultset has no jobs. + should not show. + """ + jm.store_result_set_data(pushlog_sample['revision_hash'], + pushlog_sample['push_timestamp'], + pushlog_sample['revisions']) + + resp = webapp.get( + reverse("resultset-list", kwargs={"project": jm.project}), + ) + assert resp.status_int == 200 + assert len(resp.json) == 1 + + def test_resultset_detail(webapp, eleven_jobs_processed, jm): """ test retrieving a resultset from the resultset-detail