chore: drop unreachable branches outside the signal core (no behaviour change)
- providers: _to_oanda_instrument / _to_tiingo_ticker / _to_td_symbol no longer guess a wire symbol for pairs that are not registered — the registries are the only source, so an unknown symbol raises the provider's DataIntegrityError instead of silently fetching something else. Every scanned symbol is validated against PAIR_INFO at import, so nothing reachable changes. - main / telegram_bot _fmt_price: the sub-$10 five-decimal branch could never fire for gold. - news_engine._parse_pair: BASE/QUOTE only; the Yahoo "=X" fallback was unreachable (its test goes with it). - dashboard_publisher.event_to_dict: drop minutes_until (frozen at publish time, misleading) and is_high_impact — dashboard.js never read either. - static/dashboard.html: unused id="cal-table". Tried and reverted: trimming the LogRow fields nothing in analyze_signal_log reads — the tests read them to verify the loader round-trips those DB columns, so they stay. Suite: 460 passed, 0 failed. Claude-Session: https://claude.ai/code/session_0156YhogLytzj9P2iH1skGbL
This commit is contained in:
+6
-10
@@ -755,13 +755,6 @@ def _():
|
||||
assert quote == "USD"
|
||||
|
||||
|
||||
@test("NewsEngine._parse_pair with =X suffix")
|
||||
def _():
|
||||
base, quote = NewsEngine._parse_pair("EURUSD=X")
|
||||
assert base == "EUR"
|
||||
assert quote == "USD"
|
||||
|
||||
|
||||
@test("NewsEngine._parse_pair for XAU pair")
|
||||
def _():
|
||||
base, quote = NewsEngine._parse_pair("XAU/USD")
|
||||
@@ -3597,7 +3590,11 @@ def _():
|
||||
provider = providers.oanda.OandaDataProvider.__new__(
|
||||
providers.oanda.OandaDataProvider)
|
||||
assert provider._to_oanda_instrument("XAU/USD") == "XAU_USD"
|
||||
assert provider._to_oanda_instrument("EUR/USD") == "EUR_USD"
|
||||
try:
|
||||
provider._to_oanda_instrument("EUR/USD")
|
||||
assert False, "unregistered symbol must raise, not be guessed"
|
||||
except DataIntegrityError:
|
||||
pass
|
||||
|
||||
|
||||
@test("providers.oanda: granularity mapping covers all scan timeframes")
|
||||
@@ -5151,8 +5148,7 @@ def _():
|
||||
assert d["event"] == "Non-Farm Payrolls"
|
||||
assert d["actual"] == "228K" # strings stay strings
|
||||
assert d["surprise"] == "positive" # property, added explicitly
|
||||
assert d["is_high_impact"] is True
|
||||
assert isinstance(d["minutes_until"], float)
|
||||
assert "minutes_until" not in d # frozen-at-publish value, dropped
|
||||
assert d["time"] == "2026-08-07T12:30:00+00:00"
|
||||
json.dumps(d, allow_nan=False)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user