fix tests

This commit is contained in:
Pablo Martin 2024-06-11 13:34:57 +02:00
parent 1fbdfb34c0
commit 90756d4f80

View file

@ -2,8 +2,7 @@ import datetime
import pathlib import pathlib
import pytest import pytest
from currencies import Currency from money.currency import Currency
from currencies.exceptions import CurrencyDoesNotExist
from xexe.inputs_handling import handle_get_rates_inputs from xexe.inputs_handling import handle_get_rates_inputs
from xexe.utils import DateRange from xexe.utils import DateRange
@ -33,7 +32,7 @@ def test_handle_input_rates_works_with_full_correct_inputs():
def test_handle_input_rates_raises_with_bad_currency_code(): def test_handle_input_rates_raises_with_bad_currency_code():
with pytest.raises(CurrencyDoesNotExist): with pytest.raises(ValueError):
handle_get_rates_inputs( handle_get_rates_inputs(
start_date=datetime.datetime.now(), start_date=datetime.datetime.now(),
end_date=datetime.datetime.now() + datetime.timedelta(days=7), end_date=datetime.datetime.now() + datetime.timedelta(days=7),
@ -92,7 +91,7 @@ def test_handle_input_rates_start_and_end_date_equal_works_fine():
), ),
"currencies": {Currency("USD"), Currency("EUR"), Currency("GBP")}, "currencies": {Currency("USD"), Currency("EUR"), Currency("GBP")},
"dry_run": False, "dry_run": False,
"output": "test_output.csv", "output": pathlib.Path("test_output.csv"),
} }
for key in expected_result.keys(): for key in expected_result.keys():