merge: integrate alpha management with main and sequence migration 0005
This commit is contained in:
@@ -12,6 +12,8 @@ from app.main import create_app
|
||||
from app.models import Base
|
||||
from app.worldquant import WqClient
|
||||
from tests.ai_fake import fake_model
|
||||
from tests.backtest_fake import Platform
|
||||
from tests.catalog_fake import catalog_response
|
||||
|
||||
TEST_PASSWORD = "browser-test-password"
|
||||
|
||||
@@ -81,6 +83,8 @@ def create_test_app():
|
||||
public_origin="http://127.0.0.1:5179",
|
||||
)
|
||||
records = [sample(i) for i in range(620)]
|
||||
simulations = Platform()
|
||||
simulations.existing_alpha_ids = [f"TEST{i:04}" for i in range(1, 100)]
|
||||
|
||||
def upstream(request):
|
||||
path = request.url.path
|
||||
@@ -105,8 +109,15 @@ def create_test_app():
|
||||
},
|
||||
headers={"Set-Cookie": "mock=only; Path=/"},
|
||||
)
|
||||
if path.startswith("/simulations") or (
|
||||
path.startswith("/alphas/") and path.rsplit("/", 1)[-1] in simulations.alphas
|
||||
):
|
||||
return simulations(request)
|
||||
if request.method != "GET":
|
||||
raise AssertionError("Browser acceptance attempted an upstream mutation")
|
||||
catalog = catalog_response(request)
|
||||
if catalog is not None:
|
||||
return catalog
|
||||
if path == "/users/self":
|
||||
return httpx.Response(
|
||||
200,
|
||||
|
||||
Reference in New Issue
Block a user