Skip to content

Commit

Permalink
add gbp test
Browse files Browse the repository at this point in the history
  • Loading branch information
jm-rivera committed Nov 11, 2024
1 parent 4b7d63f commit 6c52e6f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/test_dac_totals.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@
}
df_lcu = pd.DataFrame(data_lcu)

usd_to = {
"year": [2020, 2021, 2022, 2023],
"indicator": ["total_oda_official_definition"] * 4,
"donor_code": [5] * 4,
"currency": ["USD"] * 4,
"prices": ["current"] * 4,
"value": [28707.88, 33272.39, 35640.06, 36682.34],
"expected_value": [25264, 27392, 31341, 29511],
}

df_usd_to_gbp = pd.DataFrame(usd_to)


def run_constant_test(
data,
Expand Down Expand Up @@ -144,3 +156,9 @@ def test_to_constant_lcu():
run_constant_test(
data=df_lcu, source_currency="EUR", target_currency="LCU", tolerance=0.05
)


def test_to_constant_gbp():
run_constant_test(
data=df_usd_to_gbp, source_currency="USD", target_currency="GBP", tolerance=0.05
)

0 comments on commit 6c52e6f

Please sign in to comment.