def setUp(self): bug_number = 489656 bmo = BMOAgent() self.bug = bmo.get_bug(bug_number) self.people = PhonebookDirectory(dryrun=True, isTest=True) hidden_dict = { 'id': 123456, 'summary': 'hide me', 'assigned_to_detail': { 'real_name': 'nobody' }, 'groups': [{ 'name': 'security group' }] } hidden_dict.update({ 'cf_status_firefox' + version: '---' for version in getVersions() }) self.hidden_bug = Bug.from_dict(hidden_dict) assignee = '*****@*****.**' self.manager = { 'mozillaMail': '*****@*****.**', 'bugzillaEmail': '*****@*****.**' } self.person = { 'mozillaMail': '*****@*****.**', 'bugzillaEmail': '*****@*****.**' }
def setUp(self): bug_number = 489656 bmo = BMOAgent() self.bug = bmo.get_bug(bug_number) self.people = PhonebookDirectory(dryrun=True) assignee = '*****@*****.**' self.manager = {'mozillaMail': '*****@*****.**', 'bugzillaEmail': '*****@*****.**'} self.person = {'mozillaMail': '*****@*****.**', 'bugzillaEmail': '*****@*****.**'}
def setUp(self): bug_number = 489656 bmo = BMOAgent() self.bug = bmo.get_bug(bug_number) self.people = PhonebookDirectory(dryrun=True) assignee = '*****@*****.**' self.manager = { 'mozillaMail': '*****@*****.**', 'bugzillaEmail': '*****@*****.**' } self.person = { 'mozillaMail': '*****@*****.**', 'bugzillaEmail': '*****@*****.**' }
def setUp(self): bug_number = 489656 bmo = BMOAgent() self.bug = bmo.get_bug(bug_number) self.people = PhonebookDirectory(dryrun=True, isTest=True) hidden_dict = { 'id': 123456, 'summary': 'hide me', 'assigned_to_detail': {'real_name': 'nobody'}, 'groups': [{'name': 'security group'}]} hidden_dict.update({'cf_status_firefox' + version: '---' for version in getVersions()}) self.hidden_bug = Bug.from_dict(hidden_dict) assignee = '*****@*****.**' self.manager = {'mozillaMail': '*****@*****.**', 'bugzillaEmail': '*****@*****.**'} self.person = {'mozillaMail': '*****@*****.**', 'bugzillaEmail': '*****@*****.**'}
else: managers[manager_email]['nagging'] = {query: {'bugs': [bug], 'cclist': info.get('cclist', [])}, } if options.verbose: print("Creating query key %s for bug %s in nagging and \ %s" % (query, bug.id, manager_email)) for query, info in collected_queries.items(): if len(collected_queries[query]['bugs']) != 0: manual_notify[query] = {'bugs': []} if 'url' in info: manual_notify[query]['url'] = info['url'] for b in collected_queries[query]['bugs']: counter = counter + 1 send_mail = True bug = bmo.get_bug(b.id) manual_notify[query]['bugs'].append(bug) assignee = bug.assigned_to.name if "@" not in assignee: print("Error - expected email address, found %r instead in bug %s" % (assignee, b.id)) print("Check that the authentication worked correctly") sys.exit(1) if assignee in people.people_by_bzmail: person = dict(people.people_by_bzmail[assignee]) else: person = None # kick bug out if days since comment check is on if options.days_since_comment != -1: # try to get last_comment by assignee & manager if person is not None:
from auto_nag.bugzilla.agents import BMOAgent bug_number = 656222 # Load our agent for BMO bmo = BMOAgent() bug = bmo.get_bug(bug_number) class TestModels: # Test bugzilla agent methods def test_BugSearch(self): # Set whatever REST API options we want options = { 'chfieldfrom': ['2012-12-24'], 'chfieldto': ['2012-12-27'], 'chfield': ['bug_status'], 'chfieldvalue': ['RESOLVED'], 'product': ['Firefox'], 'resolution': ['FIXED'], 'include_fields': ['attachments'], } # Load our agent for BMO bmo = BMOAgent() # Get the bugs from the api buglist = bmo.get_bug_list(options) assert buglist != [] def test_BugAttributes(self): attrs = ['summary', 'id', 'assigned_to', 'creator', 'target_milestone', 'attachments', 'comments', 'history', 'keywords', 'status',
from auto_nag.bugzilla.agents import BMOAgent bug_number = 656222 # Load our agent for BMO bmo = BMOAgent() bug = bmo.get_bug(bug_number) class TestModels: # Test bugzilla agent methods def test_BugSearch(self): # Set whatever REST API options we want options = { 'chfieldfrom': ['2012-12-24'], 'chfieldto': ['2012-12-27'], 'chfield': ['bug_status'], 'chfieldvalue': ['RESOLVED'], 'product': ['Firefox'], 'resolution': ['FIXED'], 'include_fields': ['attachments'], } # Load our agent for BMO bmo = BMOAgent() # Get the bugs from the api buglist = bmo.get_bug_list(options) assert buglist != [] def test_BugAttributes(self): attrs = [ 'summary', 'id', 'assigned_to', 'creator', 'target_milestone', 'attachments', 'comments', 'history', 'keywords', 'status',
'cclist': info.get('cclist', []) }, } if options.verbose: print("Creating query key %s for bug %s in nagging and \ %s" % (query, bug.id, manager_email)) for query, info in collected_queries.items(): if len(collected_queries[query]['bugs']) != 0: manual_notify[query] = {'bugs': []} if 'url' in info: manual_notify[query]['url'] = info['url'] for b in collected_queries[query]['bugs']: counter = counter + 1 send_mail = True bug = bmo.get_bug(b.id) manual_notify[query]['bugs'].append(bug) assignee = bug.assigned_to.name if "@" not in assignee: print( "Error - expected email address, found %r instead in bug %s" % (assignee, b.id)) print("Check that the authentication worked correctly") sys.exit(1) if assignee in people.people_by_bzmail: person = dict(people.people_by_bzmail[assignee]) else: person = None # kick bug out if days since comment check is on if options.days_since_comment != -1: