Skip to content

Commit 073b625

Browse files
committed
test: update test for calculate_market_change
1 parent b3b21e6 commit 073b625

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/data/test_btanalysis.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,14 @@ def test_calculate_market_change(testdatadir):
268268
assert isinstance(result, float)
269269
assert pytest.approx(result) == 0.01100002
270270

271+
result = calculate_market_change(data, min_date=dt_utc(2018, 1, 20))
272+
assert isinstance(result, float)
273+
assert pytest.approx(result) == 0.0375149
274+
275+
# Move min-date after the last date
276+
result = calculate_market_change(data, min_date=dt_utc(2018, 2, 20))
277+
assert pytest.approx(result) == 0.0
278+
271279

272280
def test_combine_dataframes_with_mean(testdatadir):
273281
pairs = ["ETH/BTC", "ADA/BTC"]

0 commit comments

Comments
 (0)