зеркало из https://github.com/mozilla/treeherder.git
fix unit tests for exclude_empty
This commit is contained in:
Родитель
8b9a20fa8d
Коммит
3692432d0c
|
@ -47,8 +47,8 @@ def test_resultset_list_bad_project(webapp, jm):
|
||||||
assert resp.json == {"message": "No project with name foo"}
|
assert resp.json == {"message": "No project with name foo"}
|
||||||
|
|
||||||
|
|
||||||
def test_resultset_list_no_jobs_no_results(webapp, initial_data,
|
def test_resultset_list_exclude_empty_no_rs(webapp, initial_data,
|
||||||
pushlog_sample, jm):
|
pushlog_sample, jm):
|
||||||
"""
|
"""
|
||||||
test retrieving a resultset list, when the resultset has no jobs.
|
test retrieving a resultset list, when the resultset has no jobs.
|
||||||
should not show.
|
should not show.
|
||||||
|
@ -58,13 +58,30 @@ def test_resultset_list_no_jobs_no_results(webapp, initial_data,
|
||||||
pushlog_sample['revisions'])
|
pushlog_sample['revisions'])
|
||||||
|
|
||||||
resp = webapp.get(
|
resp = webapp.get(
|
||||||
reverse("resultset-list",
|
reverse("resultset-list", kwargs={"project": jm.project}),
|
||||||
kwargs={"project": jm.project})
|
{"exclude_empty": 1},
|
||||||
)
|
)
|
||||||
assert resp.status_int == 200
|
assert resp.status_int == 200
|
||||||
assert len(resp.json) == 0
|
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):
|
def test_resultset_detail(webapp, eleven_jobs_processed, jm):
|
||||||
"""
|
"""
|
||||||
test retrieving a resultset from the resultset-detail
|
test retrieving a resultset from the resultset-detail
|
||||||
|
|
Загрузка…
Ссылка в новой задаче