1
0
fin-defs/test/test_data.py
2024-09-01 17:39:22 +02:00

22 lines
503 B
Python

import pytest
import fin_defs
BAD_TICKERS = ['TEST123', '123', 'TEST.EUR', 'TEST:EUR', 'EUR:TEST']
@pytest.mark.parametrize('ticker', BAD_TICKERS)
def test_bad_tickers(ticker):
with pytest.raises(Exception) as e:
fin_defs.Stock(ticker)
@pytest.mark.parametrize('ticker', BAD_TICKERS)
def test_crypto_tickers(ticker):
fin_defs.CryptoCurrency(ticker, 'not-known')
def test_str():
NVO = fin_defs.Stock('NVO', fin_defs.EXCHANGES_BY_IDS['NYSE'])
assert str(NVO) == 'NVO.XNYS'