12 fix docs #13
@@ -12,7 +12,7 @@ def create_product_info(stock_data: dict[str, str]) -> ProductInfo:
|
||||
product.symbol = product.id.split('-')[0] # Rimuovi il suffisso della valuta per le crypto
|
||||
product.price = float(stock_data.get('Current Stock Price', f"0.0 USD").split(" ")[0]) # prende solo il numero
|
||||
product.volume_24h = 0.0 # YFinance non fornisce il volume 24h direttamente
|
||||
product.quote_currency = product.id.split('-')[0] # La valuta è la parte dopo il '-'
|
||||
product.quote_currency = product.id.split('-')[1] # La valuta è la parte dopo il '-'
|
||||
return product
|
||||
|
||||
def create_price_from_history(hist_data: dict[str, str]) -> Price:
|
||||
|
||||
@@ -33,10 +33,8 @@ class TestNewsAPITool:
|
||||
result = tool.wrapper_handler.try_call_all(lambda w: w.get_top_headlines(limit=2))
|
||||
assert isinstance(result, dict)
|
||||
assert len(result.keys()) > 0
|
||||
print("Results from providers:", result.keys())
|
||||
for provider, articles in result.items():
|
||||
for article in articles:
|
||||
print(provider, article.title)
|
||||
assert article.title is not None
|
||||
assert article.source is not None
|
||||
|
||||
@@ -45,9 +43,7 @@ class TestNewsAPITool:
|
||||
result = tool.wrapper_handler.try_call_all(lambda w: w.get_latest_news(query="crypto", limit=2))
|
||||
assert isinstance(result, dict)
|
||||
assert len(result.keys()) > 0
|
||||
print("Results from providers:", result.keys())
|
||||
for provider, articles in result.items():
|
||||
for article in articles:
|
||||
print(provider, article.title)
|
||||
assert article.title is not None
|
||||
assert article.source is not None
|
||||
|
||||
@@ -24,9 +24,7 @@ class TestSocialAPIsTool:
|
||||
result = tool.wrapper_handler.try_call_all(lambda w: w.get_top_crypto_posts(limit=2))
|
||||
assert isinstance(result, dict)
|
||||
assert len(result.keys()) > 0
|
||||
print("Results from providers:", result.keys())
|
||||
for provider, posts in result.items():
|
||||
for post in posts:
|
||||
print(provider, post.title)
|
||||
assert post.title is not None
|
||||
assert post.time is not None
|
||||
|
||||
@@ -34,7 +34,6 @@ class TestMarketDataAggregator:
|
||||
}
|
||||
|
||||
aggregated = aggregate_product_info(products)
|
||||
print(aggregated)
|
||||
assert len(aggregated) == 1
|
||||
|
||||
info = aggregated[0]
|
||||
|
||||
Reference in New Issue
Block a user