Skip to content

Commit 5b7e6e3

Browse files
crazyscientistcrobinso
authored andcommitted
Support "resolution" in Bug.build_query
This change allows to search and filter bugs by resolution. Closes #231.
1 parent bad7092 commit 5b7e6e3

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

bugzilla/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,8 @@ def build_query(self,
12051205
tags=None,
12061206
exclude_fields=None,
12071207
extra_fields=None,
1208-
limit=None):
1208+
limit=None,
1209+
resolution=None):
12091210
"""
12101211
Build a query string from passed arguments. Will handle
12111212
query parameter differences between various bugzilla versions.
@@ -1239,6 +1240,7 @@ def build_query(self,
12391240
"savedsearch": savedsearch,
12401241
"sharer_id": savedsearch_sharer_id,
12411242
"limit": limit,
1243+
"resolution": resolution,
12421244

12431245
# RH extensions... don't add any more. See comment below
12441246
"sub_components": listify(sub_component),

tests/integration/ro_api_test.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,3 +223,16 @@ def test_login_stubs(mocked_responses, backends):
223223

224224
# Works fine when not logged in
225225
bz.logout()
226+
227+
228+
def test_query_resolution(mocked_responses, backends):
229+
bz = open_bz(url=TEST_URL, **backends)
230+
231+
bugs = bz.query(bz.build_query(short_desc="ZeroDivisionError", resolution=None))
232+
assert len(bugs) == 1
233+
234+
bugs = bz.query(bz.build_query(short_desc="ZeroDivisionError", resolution="---"))
235+
assert len(bugs) == 1
236+
237+
bugs = bz.query(bz.build_query(short_desc="ZeroDivisionError", resolution="DUPLICATE"))
238+
assert len(bugs) == 0

0 commit comments

Comments
 (0)