Exemplo n.º 1
0
    def do_LOAD_ASSIGNEE(self):
        print ''
        print 'Getting assignee & cc list, please wait...'
        assignee, cc = packageInfo.getAssignedPersons(self.pkg_info)

        if self.data['component'] == 'Security':
            cc.append('*****@*****.**')

        if not self.interact:
            assignee = console.custom_input(msg='Assignee: ',
                                            preselect=assignee)
            cc = re.split(
                r',* *',
                console.custom_input(msg="CC (separated by ','): ",
                                     preselect=", ".join(cc)))
            self.data['assigned_to'] = assignee
            self.data['cc'] = cc
            return 'TEST_SUMMARY'

        print 'This/these address(es) were found:'
        print 'assignee: ' + assignee
        print 'cc: ',
        pprint.pprint(cc)

        yes = console.yes_no('Do you want to change the assignee? Yes/No')
        if yes:
            assignee = console.custom_input('New assignee: ',
                                            preselect=assignee)
            print 'Chose %s as assignee.' % assignee

        print ''
        if len(cc) > 0:
            yes = console.yes_no('Do you want to remove anybody from the cc list'\
                                 ' (one at a time)? Yes/No')
            while yes:
                console.print_list(cc, msg='Available choices')
                idx = console.get_index(len(cc), msg='Which one?')
                del cc[idx]
                print ''
                yes = console.yes_no(
                    'Do you want to remove another person? Yes/No')

        print ''
        yes = console.yes_no('Do you want to add another cc(s)? Yes/No')
        if yes:
            print ''
            print 'Enter their e-mail addresses, one at a time.'
            print "To stop, enter something that does not contain '@'."
            ans = raw_input('Cc: ')
            while '@' in ans:
                cc.append(ans)
                ans = raw_input('Cc: ')
            print 'new cc list: '
            pprint.pprint(cc)

        self.data['assigned_to'] = assignee
        self.data['cc'] = cc

        return 'TEST_SUMMARY'
Exemplo n.º 2
0
    def do_LOAD_ASSIGNEE(self):
        print ''
        print 'Getting assignee & cc list, please wait...'
        assignee, cc = packageInfo.getAssignedPersons(self.pkg_info)

        if self.data['component'] == 'Security':
            cc.append('*****@*****.**')
        
        if not self.interact:
            assignee = console.custom_input(msg='Assignee: ', preselect=assignee)
            cc = re.split(r',* *', console.custom_input(msg="CC (separated by ','): ", preselect=", ".join(cc)))
            self.data['assigned_to'] = assignee
            self.data['cc'] = cc
            return 'TEST_SUMMARY'
        
        print 'This/these address(es) were found:'
        print 'assignee: ' + assignee
        print 'cc: ',
        pprint.pprint(cc)

        yes = console.yes_no('Do you want to change the assignee? Yes/No')
        if yes:
            assignee = console.custom_input('New assignee: ', preselect=assignee)
            print 'Chose %s as assignee.' % assignee

        print ''
        if len(cc) > 0:
            yes = console.yes_no('Do you want to remove anybody from the cc list'\
                                 ' (one at a time)? Yes/No')
            while yes:
                console.print_list(cc, msg='Available choices')
                idx = console.get_index(len(cc), msg='Which one?')
                del cc[idx]
                print ''
                yes = console.yes_no('Do you want to remove another person? Yes/No')

        print ''
        yes = console.yes_no('Do you want to add another cc(s)? Yes/No')
        if yes:
            print ''
            print 'Enter their e-mail addresses, one at a time.'
            print "To stop, enter something that does not contain '@'."
            ans = raw_input('Cc: ')
            while '@' in ans:
                cc.append(ans)
                ans = raw_input('Cc: ')
            print 'new cc list: '
            pprint.pprint(cc)

        self.data['assigned_to'] = assignee
        self.data['cc'] = cc

        return 'TEST_SUMMARY'
Exemplo n.º 3
0
def test_package_getAssignedPersons():
    from bugreporter.util import packageInfo
    pkg_info = packageInfo.getInfo('rhythmbox')

    tup = ('*****@*****.**', [])
    assert packageInfo.getAssignedPersons(pkg_info) == tup
Exemplo n.º 4
0
def test_package_getAssignedPersons():
    from bugreporter.util import packageInfo
    pkg_info = packageInfo.getInfo('rhythmbox')

    tup = ('*****@*****.**', [])
    assert packageInfo.getAssignedPersons(pkg_info) == tup