From c78b2080ccaaa8f62a399c6378cf4e2fd910e855 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 28 Dec 2022 17:42:35 +0100 Subject: [PATCH] Add exception test for interest function --- tests/leverage/test_interest.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/leverage/test_interest.py b/tests/leverage/test_interest.py index 6afa73e6a..dd4983c71 100644 --- a/tests/leverage/test_interest.py +++ b/tests/leverage/test_interest.py @@ -1,5 +1,6 @@ import pytest +from freqtrade.exceptions import OperationalException from freqtrade.leverage import interest from freqtrade.util import FtPrecise @@ -29,3 +30,13 @@ def test_interest(exchange, interest_rate, hours, expected): rate=FtPrecise(interest_rate), hours=hours ))) == expected + + +def test_interest_exception(): + with pytest.raises(OperationalException, match=r"Leverage not available on .* with freqtrade"): + interest( + exchange_name='bitmex', + borrowed=FtPrecise(60.0), + rate=FtPrecise(0.0005), + hours=ten_mins + )