CryptoSymbolsTools integrazione nel sistema di strumenti.

This commit is contained in:
2025-10-21 12:22:27 +02:00
parent ea697d759f
commit b1aba10c6c
4 changed files with 36 additions and 8 deletions

View File

@@ -0,0 +1,27 @@
import pytest
from app.api.tools import CryptoSymbolsTools
@pytest.mark.tools
class TestCryptoSymbolsTools:
def test_get_symbols(self):
tool = CryptoSymbolsTools()
symbols = tool.get_all_symbols()
assert isinstance(symbols, list)
assert "BTC-USD" in symbols
def test_get_symbol_by_name(self):
tool = CryptoSymbolsTools()
results = tool.get_symbols_by_name("Bitcoin")
assert isinstance(results, list)
assert ("BTC-USD", "Bitcoin USD") in results
results = tool.get_symbols_by_name("Banana")
assert isinstance(results, list)
assert ("BANANA28886-USD", "BananaCoin USD") in results
def test_get_symbol_by_invalid_name(self):
tool = CryptoSymbolsTools()
results = tool.get_symbols_by_name("InvalidName")
assert isinstance(results, list)
assert not results