Skip to content

Commit

Permalink
New test test_currency_get_symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonfreitas committed Jan 16, 2021
1 parent 290a9f9 commit c20d9e6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_currenct.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@

import sys
sys.path.append('.')
from datetime import datetime
import pandas as pd
from bcb import currency


def test_currency_id():
assert currency.get_currency_id('USD') == 61


def test_currency_get_symbol():
start_date = datetime.strptime('2020-12-01', '%Y-%m-%d')
end_date = datetime.strptime('2020-12-05', '%Y-%m-%d')
x = currency.get_symbol('USD', start_date, end_date)
assert isinstance(x, pd.DataFrame)
x = currency.get_symbol('ZAR', start_date, end_date)
assert x is None
x = currency.get('USD', start_date, end_date)
assert isinstance(x, pd.DataFrame)
x = currency.get('ZAR', start_date, end_date)
assert x is None
x = currency.get(['ZAR', 'ZZ1'], start_date, end_date)
assert x is None

0 comments on commit c20d9e6

Please sign in to comment.