Skip to content

Commit 83eee19

Browse files
George Redivocrazyscientist
authored andcommitted
Create Bug.setsummary() method
Create a method in Bug class to set summary of the bug.
1 parent a7e6f28 commit 83eee19

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

bugzilla/bug.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,22 @@ def updateflags(self, flags):
360360
self.bugzilla.build_update(flags=flaglist))
361361

362362

363+
#######################
364+
# Bug fields handling #
365+
#######################
366+
367+
def setsummary(self, summary):
368+
"""
369+
Set the summary of bug to the given summary string
370+
"""
371+
# Create update object
372+
vals = self.bugzilla.build_update(summary=summary)
373+
374+
log.debug("setsummary: update=%s", vals)
375+
376+
# Send update to bugzilla and return
377+
return self.bugzilla.update_bugs(self.bug_id, vals)
378+
363379
########################
364380
# Experimental methods #
365381
########################

tests/test_api_bug.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ def _get_fake_bug(apiname):
184184
assert bug.get_flags("NOPE") is None
185185
assert bug.get_flag_status("NOPE") is None
186186

187+
# bug.setsummary test
188+
bug = _get_fake_bug("setsummary")
189+
bug.setsummary("My new summary")
190+
187191
# Minor get_history_raw wrapper
188192
fakebz = tests.mockbackend.make_bz(rhbz=True,
189193
bug_history_args="data/mockargs/test_bug_api_history.txt",

0 commit comments

Comments
 (0)