Lista di cryptovalute (#36)
* CryptoSymbolsTool per recuperare TUTTI i simboli delle criptovalute da Yahoo Finance * CryptoSymbolsTools integrazione nel sistema di strumenti. * Removed currency from config * fix format symbol in all markets
This commit was merged in pull request #36.
This commit is contained in:
committed by
GitHub
parent
12339ccbff
commit
2e092d3f25
27
tests/tools/test_crypto_symbols.py
Normal file
27
tests/tools/test_crypto_symbols.py
Normal 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
|
||||
Reference in New Issue
Block a user