Test isocurrencies.
This commit is contained in:
parent
c912b676b4
commit
09b7a25f9d
2 changed files with 36 additions and 5 deletions
33
tests/pricehist/test_isocurrencies.py
Normal file
33
tests/pricehist/test_isocurrencies.py
Normal file
|
@ -0,0 +1,33 @@
|
|||
from datetime import datetime
|
||||
|
||||
from pricehist import isocurrencies
|
||||
|
||||
|
||||
def test_current():
|
||||
currency = isocurrencies.by_code()["EUR"]
|
||||
assert currency.code == "EUR"
|
||||
assert currency.number == 978
|
||||
assert currency.minor_units == 2
|
||||
assert currency.name == "Euro"
|
||||
assert "GERMANY" in currency.countries
|
||||
assert "FRANCE" in currency.countries
|
||||
assert not currency.is_fund
|
||||
assert not currency.historical
|
||||
assert not currency.withdrawal_date
|
||||
|
||||
|
||||
def test_historical():
|
||||
currency = isocurrencies.by_code()["DEM"]
|
||||
assert currency.code == "DEM"
|
||||
assert currency.number == 276
|
||||
assert currency.minor_units is None
|
||||
assert currency.name == "Deutsche Mark"
|
||||
assert "GERMANY" in currency.countries
|
||||
assert not currency.is_fund
|
||||
assert currency.historical
|
||||
assert currency.withdrawal_date == "2002-03"
|
||||
|
||||
|
||||
def test_data_dates():
|
||||
assert datetime.strptime(isocurrencies.current_data_date(), "%Y-%m-%d")
|
||||
assert datetime.strptime(isocurrencies.historical_data_date(), "%Y-%m-%d")
|
Loading…
Add table
Add a link
Reference in a new issue