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 != []
Exemplo n.º 2
0
 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 != []
Exemplo n.º 3
0
        if os.path.exists(query):
            info = {}
            execfile(query, info)
            query_name = info['query_name']
            if query_name not in collected_queries:
                collected_queries[query_name] = {
                    'channel': info.get('query_channel', ''),
                    'bugs': [],
                    'cclist': options.email_cc_list,
                }
            if 'cc' in info:
                for c in info.get('cc').split(','):
                    collected_queries[query_name]['cclist'].append(c)
            if 'query_params' in info:
                print("Gathering bugs from query_params in %s" % query)
                collected_queries[query_name]['bugs'] = bmo.get_bug_list(info['query_params'])
            elif 'query_url' in info:
                print("Gathering bugs from query_url in %s" % query)
                collected_queries[query_name]['bugs'] = bmo.get_bug_list(query_url_to_dict(info['query_url']))
                collected_queries[query_name]['url'] = info['query_url']
                # print "DEBUG: %d bug(s) found for query %s" % \
                #   (len(collected_queries[query_name]['bugs']), info['query_url'])
            else:
                print("Error - no valid query params or url in the config file")
                sys.exit(1)
        else:
            print("Not a valid path: %s" % query)
    total_bugs = 0
    for channel in collected_queries.keys():
        total_bugs += len(collected_queries[channel]['bugs'])
Exemplo n.º 4
0
     if os.path.exists(query):
         info = {}
         execfile(query, info)
         query_name = info['query_name']
         if query_name not in collected_queries:
             collected_queries[query_name] = {
                 'channel': info.get('query_channel', ''),
                 'bugs': [],
                 'cclist': options.email_cc_list,
             }
         if 'cc' in info:
             for c in info.get('cc').split(','):
                 collected_queries[query_name]['cclist'].append(c)
         if 'query_params' in info:
             print("Gathering bugs from query_params in %s" % query)
             collected_queries[query_name]['bugs'] = bmo.get_bug_list(
                 info['query_params'])
         elif 'query_url' in info:
             print("Gathering bugs from query_url in %s" % query)
             collected_queries[query_name]['bugs'] = bmo.get_bug_list(
                 query_url_to_dict(info['query_url']))
             collected_queries[query_name]['url'] = info['query_url']
             # print "DEBUG: %d bug(s) found for query %s" % \
             #   (len(collected_queries[query_name]['bugs']), info['query_url'])
         else:
             print(
                 "Error - no valid query params or url in the config file")
             sys.exit(1)
     else:
         print("Not a valid path: %s" % query)
 total_bugs = 0
 for channel in collected_queries.keys():