mirror of
https://github.com/TauricResearch/TradingAgents.git
synced 2026-11-22 09:09:55 +02:00
refactor(dataflows): name the unavailable-vendor error for what it covers
- VendorRateLimitError is VendorUnavailableError: a vendor that throttled or failed the request
This commit is contained in:
@@ -16,7 +16,7 @@ from tradingagents.dataflows.errors import (
|
||||
NoMarketDataError,
|
||||
VendorError,
|
||||
VendorNotConfiguredError,
|
||||
VendorRateLimitError,
|
||||
VendorUnavailableError,
|
||||
)
|
||||
from tradingagents.dataflows.vendors.alpha_vantage.common import (
|
||||
AlphaVantageNotConfiguredError,
|
||||
@@ -28,7 +28,7 @@ from tradingagents.dataflows.vendors.fred import FredNotConfiguredError
|
||||
@pytest.mark.unit
|
||||
class HierarchyTests(unittest.TestCase):
|
||||
def test_all_conditions_derive_from_vendor_error(self):
|
||||
for cls in (NoMarketDataError, VendorRateLimitError, VendorNotConfiguredError):
|
||||
for cls in (NoMarketDataError, VendorUnavailableError, VendorNotConfiguredError):
|
||||
self.assertTrue(issubclass(cls, VendorError))
|
||||
|
||||
def test_not_configured_is_still_a_value_error(self):
|
||||
@@ -36,7 +36,7 @@ class HierarchyTests(unittest.TestCase):
|
||||
self.assertTrue(issubclass(VendorNotConfiguredError, ValueError))
|
||||
|
||||
def test_vendor_named_errors_subclass_the_generic_bases(self):
|
||||
self.assertTrue(issubclass(AlphaVantageRateLimitError, VendorRateLimitError))
|
||||
self.assertTrue(issubclass(AlphaVantageRateLimitError, VendorUnavailableError))
|
||||
self.assertTrue(issubclass(AlphaVantageNotConfiguredError, VendorNotConfiguredError))
|
||||
self.assertTrue(issubclass(FredNotConfiguredError, VendorNotConfiguredError))
|
||||
# ... and therefore still ValueErrors
|
||||
|
||||
Reference in New Issue
Block a user