absolution-omega / tests /conftest.py
2Btainment's picture
Owner-only project library via HF OAuth; isolated 24h guest workspaces (server-side enforced)
6049960 verified
Raw History Blame Contribute Delete
588 Bytes
import time
import pytest
from app import access
@pytest.fixture(autouse=True)
def legacy_owner_session(request, monkeypatch):
"""Pre-v0.10 tests expect projects directly under data_root: run them as the owner.
Isolation itself is covered by test_access.py (real anonymous sessions)."""
if request.module.__name__.endswith("test_access"):
return
monkeypatch.setattr(access.Sessions, "new_anonymous",
lambda self: {"kind": "hf", "user": access.OWNER, "sid": "0" * 32,
"exp": int(time.time()) + 3600})