From 13f1b0314a1606017e402c4f9eedde8a5367edfe Mon Sep 17 00:00:00 2001 From: Jonathan Daniel Date: Tue, 29 Oct 2024 00:16:33 +0200 Subject: [PATCH] Fix Discount and Mercantile Gold (XAU) issue --- tests/test_discount.py | 11 +++++++---- tests/test_mercantile.py | 9 +++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/test_discount.py b/tests/test_discount.py index a92000e..5b19de9 100644 --- a/tests/test_discount.py +++ b/tests/test_discount.py @@ -63,13 +63,16 @@ def currencies_fixture() -> set[CurrencyCode]: } +@pytest.mark.parametrize( + "dropped_currencies", [[CurrencyCode.XAU]] +) # There's an issue with Gold @pytest.mark.live def test_df( - df: pd.DataFrame, currencies: set[CurrencyCode], drop_ngn: bool = True + df: pd.DataFrame, + currencies: set[CurrencyCode], + dropped_currencies: list[CurrencyCode], ) -> None: assert set(df.index) == currencies - if drop_ngn: - # There's an issue with Nigerian naira - df = df.drop(index=CurrencyCode.NGN) + df = df.drop(index=dropped_currencies) for method in ("cash", "transfer"): assert (df[(method, "sell")] >= df[(method, "buy")]).all() diff --git a/tests/test_mercantile.py b/tests/test_mercantile.py index c681176..0fdb9a0 100644 --- a/tests/test_mercantile.py +++ b/tests/test_mercantile.py @@ -49,6 +49,11 @@ def currencies_fixture() -> set[CurrencyCode]: } +@pytest.mark.parametrize("dropped_currencies", [[CurrencyCode.XAU]]) @pytest.mark.live -def test_df(df: pd.DataFrame, currencies: set[CurrencyCode]) -> None: - _test_df_helper(df, currencies, drop_ngn=False) +def test_df( + df: pd.DataFrame, + currencies: set[CurrencyCode], + dropped_currencies: list[CurrencyCode], +) -> None: + _test_df_helper(df, currencies, dropped_currencies=dropped_currencies)