Пример #1
0
    def test_positive_remove_user_by_name(self):
        """Create new user group using valid user attached to that group. Then
        remove that user from user group by name

        @Feature: Usergroup

        @Assert: User is removed from user group successfully.
        """
        user = make_user()
        user_group = make_usergroup({'user-ids': user['id']})
        self.assertEqual(len(user_group['users']), 1)
        UserGroup.remove_user({
            'id': user_group['id'],
            'user': user['login'],
        })
        user_group = UserGroup.info({'id': user_group['id']})
        self.assertEqual(len(user_group['users']), 0)
Пример #2
0
    def test_positive_add_and_remove_elements(self):
        """Create new user group. Add and remove several element from the group.

        :id: a4ce8724-d3c8-4c00-9421-aaa40394134d

        :BZ: 1395229

        :expectedresults: Elements are added to user group and then removed
                          successfully.

        :CaseLevel: Integration
        """
        role = make_role()
        user_group = make_usergroup()
        user = make_user()
        sub_user_group = make_usergroup()

        # Add elements by id
        UserGroup.add_role({'id': user_group['id'], 'role-id': role['id']})
        UserGroup.add_user({'id': user_group['id'], 'user-id': user['id']})
        UserGroup.add_user_group({
            'id': user_group['id'],
            'user-group-id': sub_user_group['id']
        })

        user_group = UserGroup.info({'id': user_group['id']})
        self.assertEqual(len(user_group['roles']), 1)
        self.assertEqual(user_group['roles'][0], role['name'])
        self.assertEqual(len(user_group['users']), 1)
        self.assertEqual(user_group['users'][0], user['login'])
        self.assertEqual(len(user_group['user-groups']), 1)
        self.assertEqual(user_group['user-groups'][0]['usergroup'],
                         sub_user_group['name'])

        # Remove elements by name
        UserGroup.remove_role({'id': user_group['id'], 'role': role['name']})
        UserGroup.remove_user({'id': user_group['id'], 'user': user['login']})
        UserGroup.remove_user_group({
            'id': user_group['id'],
            'user-group': sub_user_group['name']
        })

        user_group = UserGroup.info({'id': user_group['id']})
        self.assertEqual(len(user_group['roles']), 0)
        self.assertEqual(len(user_group['users']), 0)
        self.assertEqual(len(user_group['user-groups']), 0)
Пример #3
0
    def test_positive_remove_user_by_name(self):
        """Create new user group using valid user attached to that group. Then
        remove that user from user group by name

        @Feature: Usergroup

        @Assert: User is removed from user group successfully.
        """
        user = make_user()
        user_group = make_usergroup({'user-ids': user['id']})
        self.assertEqual(len(user_group['users']), 1)
        UserGroup.remove_user({
            'id': user_group['id'],
            'user': user['login'],
        })
        user_group = UserGroup.info({'id': user_group['id']})
        self.assertEqual(len(user_group['users']), 0)
Пример #4
0
    def test_positive_remove_user_by_name(self):
        """Create new user group using valid user attached to that group. Then
        remove that user from user group by name

        :id: e99b215b-05bb-4e7b-a11a-cd506d88df6c

        :expectedresults: User is removed from user group successfully.

        :CaseLevel: Integration
        """
        user = make_user()
        user_group = make_usergroup({'user-ids': user['id']})
        self.assertEqual(len(user_group['users']), 1)
        UserGroup.remove_user({
            'id': user_group['id'],
            'user': user['login'],
        })
        user_group = UserGroup.info({'id': user_group['id']})
        self.assertEqual(len(user_group['users']), 0)
Пример #5
0
    def test_positive_remove_user_by_id(self):
        """Create new user group using valid user attached to that group. Then
        remove that user from user group by id

        :id: 9ae91110-88dd-4449-82c7-59f626fdd2be

        :expectedresults: User is removed from user group successfully.

        :CaseLevel: Integration
        """
        user = make_user()
        user_group = make_usergroup({'user-ids': user['id']})
        self.assertEqual(len(user_group['users']), 1)
        UserGroup.remove_user({
            'id': user_group['id'],
            'user-id': user['id'],
        })
        user_group = UserGroup.info({'id': user_group['id']})
        self.assertEqual(len(user_group['users']), 0)
Пример #6
0
    def test_positive_remove_user_by_name(self):
        """Create new user group using valid user attached to that group. Then
        remove that user from user group by name

        :id: e99b215b-05bb-4e7b-a11a-cd506d88df6c

        :expectedresults: User is removed from user group successfully.

        :CaseLevel: Integration
        """
        user = make_user()
        user_group = make_usergroup({'user-ids': user['id']})
        self.assertEqual(len(user_group['users']), 1)
        UserGroup.remove_user({
            'id': user_group['id'],
            'user': user['login'],
        })
        user_group = UserGroup.info({'id': user_group['id']})
        self.assertEqual(len(user_group['users']), 0)
Пример #7
0
    def test_positive_remove_user_by_id(self):
        """Create new user group using valid user attached to that group. Then
        remove that user from user group by id

        :id: 9ae91110-88dd-4449-82c7-59f626fdd2be

        :expectedresults: User is removed from user group successfully.

        :CaseLevel: Integration
        """
        user = make_user()
        user_group = make_usergroup({'user-ids': user['id']})
        self.assertEqual(len(user_group['users']), 1)
        UserGroup.remove_user({
            'id': user_group['id'],
            'user-id': user['id'],
        })
        user_group = UserGroup.info({'id': user_group['id']})
        self.assertEqual(len(user_group['users']), 0)