fix unit tests for exclude_empty

This commit is contained in:
Cameron Dawson 2013-10-02 17:11:11 -07:00
Родитель 8b9a20fa8d
Коммит 3692432d0c
1 изменённых файлов: 21 добавлений и 4 удалений

Просмотреть файл

@ -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