Skip to content

Commit

Permalink
Fix Discount and Mercantile Gold (XAU) issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jond01 committed Oct 28, 2024
1 parent 2d467d6 commit 13f1b03
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
11 changes: 7 additions & 4 deletions tests/test_discount.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
9 changes: 7 additions & 2 deletions tests/test_mercantile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 13f1b03

Please sign in to comment.