Added tests and docstring to exchange funding_fee methods, removed utils

This commit is contained in:
Sam Germain
2021-09-09 01:43:05 -06:00
parent d54117990b
commit dfb9937436
9 changed files with 134 additions and 24 deletions

View File

@@ -105,3 +105,11 @@ def test_stoploss_adjust_binance(mocker, default_conf):
# Test with invalid order case
order['type'] = 'stop_loss'
assert not exchange.stoploss_adjust(1501, order)
def test_get_funding_rate():
return
def test__get_funding_fee():
return

View File

@@ -2994,3 +2994,15 @@ def test_get_funding_fees(default_conf, mocker, exchange_name):
pair="XRP/USDT",
since=unix_time
)
def test_get_mark_price():
return
def test_get_funding_fee_dates():
return
def test_calculate_funding_fees():
return

View File

@@ -1,3 +1,4 @@
from datetime import datetime, timedelta
from random import randint
from unittest.mock import MagicMock
@@ -191,3 +192,18 @@ def test_get_order_id(mocker, default_conf):
}
}
assert exchange.get_order_id_conditional(order) == '1111'
@pytest.mark.parametrize("pair,when", [
('XRP/USDT', datetime.utcnow()),
('ADA/BTC', datetime.utcnow()),
('XRP/USDT', datetime.utcnow() - timedelta(hours=30)),
])
def test__get_funding_rate(default_conf, mocker, pair, when):
api_mock = MagicMock()
exchange = get_patched_exchange(mocker, default_conf, api_mock, id="ftx")
assert exchange._get_funding_rate(pair, when) is None
def test__get_funding_fee():
return