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': '*****@*****.**'
     }
Exemplo n.º 2
0
 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': '*****@*****.**'}
Exemplo n.º 3
0
 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': '*****@*****.**'
     }
Exemplo n.º 4
0
 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': '*****@*****.**'}
Exemplo n.º 5
0
        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:
Exemplo n.º 6
0
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',
Exemplo n.º 8
0
                    '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: