| monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x134b8ca10>
|
|
|
| def test_open_ramp_route_post_writes_caps_through_ff(monkeypatch):
|
| """POST ?knob=caps&value=2,4 → FF.set_flag_override(MARKET_STATE_ETF_OPEN_RAMP_CAPS, [0.02, 0.04])."""
|
| captured = {}
|
|
|
| def fake_set(name, value, *, actor, reason, **_):
|
| captured["name"] = name
|
| captured["value"] = value
|
| captured["actor"] = actor
|
| captured["reason"] = reason
|
| return {"new_effective": value, "old_effective": (0.05, 0.10)}
|
|
|
| monkeypatch.setattr(FF, "set_flag_override", fake_set)
|
| import status as _status_mod
|
| # Stub the response builder so we don't need live Redis for the read-back side.
|
| monkeypatch.setattr(_status_mod, "_open_ramp_table_response",
|
| lambda: _status_mod.jsonify({"ok": True, "echoed": True}))
|
| client = _status_mod.app.test_client()
|
| resp = client.post("/api/tide-wave/open-ramp", query_string={
|
| "debug": "debug_claude_2025",
|
| "knob": "caps",
|
| "value": "2,4",
|
| "actor": "tester",
|
| "reason": "panel edit",
|
| })
|
| > assert resp.status_code == 200, resp.data
|
| E AssertionError: b'{"error":"need ?knob=MARKET_STATE_ETF_OPEN_RAMP_ENABLED|MARKET_STATE_ETF_OPEN_RAMP_CAPS|MARKET_STATE_ETF_OPEN_RAMP_BOUNDS","ok":false}
|
| E '
|
| E assert 400 == 200
|
| E + where 400 = <WrapperTestResponse streamed [400 BAD REQUEST]>.status_code
|
|
|
| tests/test_tide_wave_open_ramp_ui.py:550: AssertionError
|