Пример #1
0
    def test_positive_delete_cloned_builtin(self):
        """Clone a builtin role and attempt to delete it

        :id: 1fd9c636-596a-4cb2-b100-de19238042cc

        :BZ: 1426672

        :expectedresults: role was successfully deleted

        :CaseImportance: Critical

        """
        role_list = Role.list({'search': f'name=\\"{choice(ROLES)}\\"'})
        assert len(role_list) == 1
        cloned_role = Role.clone({'id': role_list[0]['id'], 'new-name': gen_string('alphanumeric')})
        Role.delete({'id': cloned_role['id']})
        with pytest.raises(CLIReturnCodeError):
            Role.info({'id': cloned_role['id']})
Пример #2
0
    def test_positive_delete_cloned_builtin(self):
        """Clone a builtin role and attempt to delete it

        :id: 1fd9c636-596a-4cb2-b100-de19238042cc

        :BZ: 1426672

        :expectedresults: role was successfully deleted

        :CaseImportance: Critical

        """
        role_list = Role.list({
            'search': 'name=\\"{}\\"'.format(choice(ROLES))})
        self.assertEqual(len(role_list), 1)
        cloned_role = Role.clone({
            'id': role_list[0]['id'],
            'new-name': gen_string('alphanumeric'),
        })
        Role.delete({'id': cloned_role['id']})
        with self.assertRaises(CLIReturnCodeError):
            Role.info({'id': cloned_role['id']})