@@ -343,18 +343,30 @@ def flagstr(b):
343343 ret .append (flag ["name" ] + flag ["status" ])
344344 return " " .join (sorted (ret ))
345345
346- def cleardict (b ):
346+ def cleardict_old (b ):
347+ """
348+ Clear flag dictionary, for format meant for bug.updateflags
349+ """
347350 clearflags = {}
348351 for flag in b .flags :
349352 clearflags [flag ["name" ]] = "X"
350353 return clearflags
351354
355+ def cleardict_new (b ):
356+ """
357+ Clear flag dictionary, for format meant for update_bugs
358+ """
359+ clearflags = []
360+ for flag in b .flags :
361+ clearflags .append ({"name" : flag ["name" ], "status" : "X" })
362+ return clearflags
363+
352364 bug1 = bz .getbug (bugid1 )
353- if cleardict (bug1 ):
354- bug1 .updateflags (cleardict (bug1 ))
365+ if cleardict_old (bug1 ):
366+ bug1 .updateflags (cleardict_old (bug1 ))
355367 bug2 = bz .getbug (bugid2 )
356- if cleardict (bug2 ):
357- bug2 .updateflags (cleardict (bug2 ))
368+ if cleardict_old (bug2 ):
369+ bug2 .updateflags (cleardict_old (bug2 ))
358370
359371
360372 # Set flags and confirm
@@ -371,15 +383,15 @@ def cleardict(b):
371383 self .assertEquals (bug1 .get_flag_status ("requires_doc_text" ), "-" )
372384
373385 # Clear flags
374- if cleardict (bug1 ):
375- bug1 . updateflags ( cleardict (bug1 ))
386+ if cleardict_new (bug1 ):
387+ bz . update_flags ( bug1 . id , cleardict_new (bug1 ))
376388 bug1 .refresh ()
377- if cleardict (bug2 ):
378- bug2 . updateflags ( cleardict (bug2 ))
389+ if cleardict_new (bug2 ):
390+ bz . update_flags ( bug2 . id , cleardict_new (bug2 ))
379391 bug2 .refresh ()
380392
381- self .assertEquals (cleardict (bug1 ), {})
382- self .assertEquals (cleardict (bug2 ), {})
393+ self .assertEquals (cleardict_old (bug1 ), {})
394+ self .assertEquals (cleardict_old (bug2 ), {})
383395
384396 # Set "Fixed In" field
385397 origfix1 = bug1 .fixed_in
0 commit comments