Extract price logic to PriceService
- Create PriceService with get_recent_prices() and fetch_and_store_price() - Update routes/audit.py to use PriceService instead of direct queries - Use PriceHistoryMapper consistently - Update test to patch services.price.fetch_btc_eur_price
This commit is contained in:
parent
168b67acee
commit
badb45da59
4 changed files with 324 additions and 50 deletions
|
|
@ -280,7 +280,7 @@ class TestManualFetch:
|
|||
existing_id = existing.id
|
||||
|
||||
# Mock fetch_btc_eur_price to return the same timestamp
|
||||
with patch("routes.audit.fetch_btc_eur_price") as mock_fetch:
|
||||
with patch("services.price.fetch_btc_eur_price") as mock_fetch:
|
||||
mock_fetch.return_value = (95000.0, fixed_timestamp)
|
||||
|
||||
async with client_factory.create(cookies=admin_user["cookies"]) as authed:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue