Esempio n. 1
0
    def test_group_add_owner_new(self):
        '''this function tests the group_add_owner method for a valid user not already
        owner of the group'''
        self.client.create(self.group_name)
        group_already_exists, success = \
            group_validate(self.group_name, '', self.client)
        group_already_owner_start = group_already_owner('magarvey', self.group_name, self.client)
        try:
            subscribed, owner = group_add_owner('magarvey', self.group_name, self.client)
            group_add_owner_success = True
        except:
            group_add_owner_success = False
        group_already_exists, success = \
            group_validate(self.group_name, '', self.client)

        sleep(5)
        group_already_owner_end = group_already_owner('magarvey', self.group_name, self.client)

        '''DEBUGGIN'''
        print str(self.client.status(self.group_name))
        print str(group_already_owner('magarvey',self.group_name,self.client))

        assert group_already_exists
        assert (group_already_owner_start == False)
        assert (success == False)
        assert group_add_owner_success
        assert subscribed
        assert owner
        assert group_already_owner_end
Esempio n. 2
0
 def test_group_add_owner_existing(self):
     '''this function tests the group_add_owner method on a group that the user
     is already owner of'''
     group_already_exists, success = \
         group_validate('abc_calendar', '', self.client)
     group_already_owner_start = group_already_owner('magarvey', 'abc_group', self.client)
     try:
         group_add_owner('magarvey', 'abc_group', self.client)
         group_add_owner_success = True
     except:
         group_add_owner_success = False
     group_already_owner_end = group_already_owner('magarvey','abc_group',self.client)
     assert group_already_exists
     assert group_already_owner_start
     assert group_already_owner_end
     assert (success == False)
     assert (group_add_owner_success == True)
Esempio n. 3
0
 def test_group_add_owner_invalid(self):
     '''this function tests the group_add_owner method on a user that is not in the
     gtest.pdx.edu system'''
     group_already_exists, success = \
         group_validate('abc_group', '', self.client)
     try:
         group_already_owner_start = group_already_owner('?//%/$/#@', 'abc_group', self.client)
     except:
         group_already_owner_start = False
     try:
         subscribed, owner = group_add_owner('?//%/$/#@', 'abc_group', self.client)
         group_add_owner_success = True
     except:
         group_add_owner_success = False
     assert group_already_exists
     assert (group_already_owner_start == False)
     assert (success == False)
     assert (group_add_owner_success == True)
     assert (subscribed == False)
     assert (owner == False)
Esempio n. 4
0
                try:
                    #client = Group( google.keys()[0] )
                    client = Group(domain=group.keys()[0],adminuser=group[group.keys()[0]]['adminuser'],password=group[group.keys()[0]]['password'])
                    group_already_exists, success = group_validate( 
                    group_name, group_description, client )

                    #create success message
                    response = process_group( 
                        group_name, group_description, 
                        group_already_exists, success )

                    if group_requestor_1:
                        try:
                            if requestor_validate( group_requestor_1, client ):
                                requestor_1_already_owner = group_already_owner(
                                    group_requestor_1, 
                                    group_name, 
                                    client )

                                response += group_process_requestor(
                                    group_requestor_1, 
                                    group_name, 
                                    requestor_1_already_owner, 
                                    client )
                            else:
                                response += '\n<br/>' + group_requestor_1 + \
                                    ' is not a valid user'
                        except Exception, err:
                            response += '\n<br/>' + str(err)

                    if group_requestor_2:
                        try:
Esempio n. 5
0
 def test_group_already_owner_false(self):
     '''this function tests running group_already_owner on a group where we
     know that the given user is not already an owner'''
     owner_already = group_already_owner('phony_phony_phony', 'abc_group', self.client)
     assert (owner_already == False)
Esempio n. 6
0
 def test_group_already_owner_true(self):
     '''this function tests running group_already_owner on a group where we
     know that the given user is already an owner'''
     owner_already = group_already_owner('magarvey', 'abc_group', self.client)
     assert owner_already