docs: document Tencent quote refresh
This commit is contained in:
@@ -64,3 +64,13 @@ def test_provider_builds_batch_query_and_maps_by_code():
|
||||
|
||||
assert "q=sz000001" in calls[0]
|
||||
assert quotes["000001"].price == Decimal("10.60")
|
||||
|
||||
|
||||
def test_provider_wraps_fetch_errors():
|
||||
def failing_fetch(url: str, timeout: float) -> bytes:
|
||||
raise OSError("bad gateway")
|
||||
|
||||
provider = TencentQuoteProvider(fetcher=failing_fetch)
|
||||
|
||||
with pytest.raises(QuoteFetchError, match="Tencent quote request failed"):
|
||||
provider.fetch_quotes([Instrument(id=1, code="000001", name="平安银行")])
|
||||
|
||||
Reference in New Issue
Block a user