refactor: centralize numeric normalization
This commit is contained in:
@@ -6,11 +6,13 @@ import unittest
|
||||
from pathlib import Path
|
||||
|
||||
import market_insights
|
||||
from backend.data.numbers import non_nan_number
|
||||
from backend.features.market import insights as canonical_insights
|
||||
from tests.preservation_helpers import (
|
||||
assert_frontend_runtime_matches_audited_baseline,
|
||||
assert_moved_asset_matches,
|
||||
assert_page_prefix_matches,
|
||||
function_contract,
|
||||
)
|
||||
|
||||
|
||||
@@ -106,6 +108,11 @@ class MarketInsightsSliceSourceEquivalenceTests(unittest.TestCase):
|
||||
MARKET_INSIGHT_METHODS,
|
||||
)
|
||||
self.assertIs(market_insights.MarketInsightsService, canonical_insights.MarketInsightsService)
|
||||
self.assertEqual(
|
||||
function_contract(ORIGINAL_ROOT / "market_insights.py", "_number"),
|
||||
function_contract(APP_ROOT / "backend/data/numbers.py", "non_nan_number"),
|
||||
)
|
||||
self.assertIs(canonical_insights._number, non_nan_number)
|
||||
|
||||
def test_dashboard_service_methods_are_exact_original_ast(self) -> None:
|
||||
original = ORIGINAL_ROOT / "server.py"
|
||||
|
||||
Reference in New Issue
Block a user