12 fix docs #13

Merged
Berack96 merged 18 commits from 12-fix-docs into main 2025-10-02 01:41:00 +02:00
4 changed files with 1 additions and 8 deletions
Showing only changes of commit c978b92268 - Show all commits

View File

@@ -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.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.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.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 return product
def create_price_from_history(hist_data: dict[str, str]) -> Price: def create_price_from_history(hist_data: dict[str, str]) -> Price:

View File

@@ -33,10 +33,8 @@ class TestNewsAPITool:
result = tool.wrapper_handler.try_call_all(lambda w: w.get_top_headlines(limit=2)) result = tool.wrapper_handler.try_call_all(lambda w: w.get_top_headlines(limit=2))
assert isinstance(result, dict) assert isinstance(result, dict)
assert len(result.keys()) > 0 assert len(result.keys()) > 0
print("Results from providers:", result.keys())
for provider, articles in result.items(): for provider, articles in result.items():
for article in articles: for article in articles:
print(provider, article.title)
assert article.title is not None assert article.title is not None
assert article.source 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)) result = tool.wrapper_handler.try_call_all(lambda w: w.get_latest_news(query="crypto", limit=2))
assert isinstance(result, dict) assert isinstance(result, dict)
assert len(result.keys()) > 0 assert len(result.keys()) > 0
print("Results from providers:", result.keys())
for provider, articles in result.items(): for provider, articles in result.items():
for article in articles: for article in articles:
print(provider, article.title)
assert article.title is not None assert article.title is not None
assert article.source is not None assert article.source is not None

View File

@@ -24,9 +24,7 @@ class TestSocialAPIsTool:
result = tool.wrapper_handler.try_call_all(lambda w: w.get_top_crypto_posts(limit=2)) result = tool.wrapper_handler.try_call_all(lambda w: w.get_top_crypto_posts(limit=2))
assert isinstance(result, dict) assert isinstance(result, dict)
assert len(result.keys()) > 0 assert len(result.keys()) > 0
print("Results from providers:", result.keys())
for provider, posts in result.items(): for provider, posts in result.items():
for post in posts: for post in posts:
print(provider, post.title)
assert post.title is not None assert post.title is not None
assert post.time is not None assert post.time is not None

View File

@@ -34,7 +34,6 @@ class TestMarketDataAggregator:
} }
aggregated = aggregate_product_info(products) aggregated = aggregate_product_info(products)
print(aggregated)
assert len(aggregated) == 1 assert len(aggregated) == 1
info = aggregated[0] info = aggregated[0]