@pytest.fixture
def scope_factory():
    from rucio.common.utils import generate_uuid
    from rucio.core.scope import add_scope
    from rucio.common.types import InternalAccount, InternalScope

    def create_scopes(vos, account_name=None):
        scope_uuid = str(generate_uuid()).lower()[:16]
        scope_name = ('shr_%s' % scope_uuid)
        created_scopes = []
        for vo in vos:
            scope = InternalScope(scope_name, vo=vo)
            add_scope(scope, InternalAccount((account_name if account_name else 'root'), vo=vo))
            created_scopes.append(scope)
        return (scope_name, created_scopes)
    return create_scopes
@pytest.fixture
def scope_factory():
    from rucio.common.utils import generate_uuid
    from rucio.core.scope import add_scope
    from rucio.common.types import InternalAccount, InternalScope

    def create_scopes(vos, account_name=None):
        scope_uuid = str(generate_uuid()).lower()[:16]
        scope_name = ('shr_%s' % scope_uuid)
        created_scopes = []
        for vo in vos:
            scope = InternalScope(scope_name, vo=vo)
            add_scope(scope, InternalAccount((account_name if account_name else 'root'), vo=vo))
            created_scopes.append(scope)
        return (scope_name, created_scopes)
    return create_scopes