Files
Shadowbroker/backend/tests/test_prediction_markets_opt_in.py
BigBodyCobain 80a01275ff Add MKT opt-in on threat intercept, jittered market fetches, and Sentinel multi-scene dossier.
Operators enable Polymarket/Kalshi correlation from Global Threat Intercept with a consent dialog; polls use a jittered schedule separate from the slow tier. Right-click Sentinel imagery returns up to three signed scenes again.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 09:01:21 -06:00

25 lines
1006 B
Python

"""UI opt-in for prediction markets (Global Threat Intercept)."""
from services import prediction_markets_settings as pm_settings
from services.fetchers import prediction_markets
def test_ui_opt_in_enables_fetch(monkeypatch, tmp_path):
opt_file = tmp_path / "prediction_markets_opt_in.json"
monkeypatch.setattr(pm_settings, "_OPT_IN_FILE", opt_file)
monkeypatch.delenv("PREDICTION_MARKETS_ENABLED", raising=False)
assert pm_settings.prediction_markets_fetch_enabled() is False
pm_settings.set_prediction_markets_ui_opt_in(True)
assert pm_settings.prediction_markets_fetch_enabled() is True
assert prediction_markets.prediction_markets_fetch_enabled() is True
def test_env_force_on_without_ui_file(monkeypatch, tmp_path):
opt_file = tmp_path / "prediction_markets_opt_in.json"
monkeypatch.setattr(pm_settings, "_OPT_IN_FILE", opt_file)
monkeypatch.setenv("PREDICTION_MARKETS_ENABLED", "true")
assert pm_settings.prediction_markets_fetch_enabled() is True