Fix some futures symbol naming in tests
This commit is contained in:
+16
-16
@@ -3001,85 +3001,85 @@ def mark_ohlcv():
|
|||||||
def funding_rate_history_hourly():
|
def funding_rate_history_hourly():
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
"symbol": "ADA/USDT",
|
"symbol": "ADA/USDT:USDT",
|
||||||
"fundingRate": -0.000008,
|
"fundingRate": -0.000008,
|
||||||
"timestamp": 1630454400000,
|
"timestamp": 1630454400000,
|
||||||
"datetime": "2021-09-01T00:00:00.000Z"
|
"datetime": "2021-09-01T00:00:00.000Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"symbol": "ADA/USDT",
|
"symbol": "ADA/USDT:USDT",
|
||||||
"fundingRate": -0.000004,
|
"fundingRate": -0.000004,
|
||||||
"timestamp": 1630458000000,
|
"timestamp": 1630458000000,
|
||||||
"datetime": "2021-09-01T01:00:00.000Z"
|
"datetime": "2021-09-01T01:00:00.000Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"symbol": "ADA/USDT",
|
"symbol": "ADA/USDT:USDT",
|
||||||
"fundingRate": 0.000012,
|
"fundingRate": 0.000012,
|
||||||
"timestamp": 1630461600000,
|
"timestamp": 1630461600000,
|
||||||
"datetime": "2021-09-01T02:00:00.000Z"
|
"datetime": "2021-09-01T02:00:00.000Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"symbol": "ADA/USDT",
|
"symbol": "ADA/USDT:USDT",
|
||||||
"fundingRate": -0.000003,
|
"fundingRate": -0.000003,
|
||||||
"timestamp": 1630465200000,
|
"timestamp": 1630465200000,
|
||||||
"datetime": "2021-09-01T03:00:00.000Z"
|
"datetime": "2021-09-01T03:00:00.000Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"symbol": "ADA/USDT",
|
"symbol": "ADA/USDT:USDT",
|
||||||
"fundingRate": -0.000007,
|
"fundingRate": -0.000007,
|
||||||
"timestamp": 1630468800000,
|
"timestamp": 1630468800000,
|
||||||
"datetime": "2021-09-01T04:00:00.000Z"
|
"datetime": "2021-09-01T04:00:00.000Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"symbol": "ADA/USDT",
|
"symbol": "ADA/USDT:USDT",
|
||||||
"fundingRate": 0.000003,
|
"fundingRate": 0.000003,
|
||||||
"timestamp": 1630472400000,
|
"timestamp": 1630472400000,
|
||||||
"datetime": "2021-09-01T05:00:00.000Z"
|
"datetime": "2021-09-01T05:00:00.000Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"symbol": "ADA/USDT",
|
"symbol": "ADA/USDT:USDT",
|
||||||
"fundingRate": 0.000019,
|
"fundingRate": 0.000019,
|
||||||
"timestamp": 1630476000000,
|
"timestamp": 1630476000000,
|
||||||
"datetime": "2021-09-01T06:00:00.000Z"
|
"datetime": "2021-09-01T06:00:00.000Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"symbol": "ADA/USDT",
|
"symbol": "ADA/USDT:USDT",
|
||||||
"fundingRate": 0.000003,
|
"fundingRate": 0.000003,
|
||||||
"timestamp": 1630479600000,
|
"timestamp": 1630479600000,
|
||||||
"datetime": "2021-09-01T07:00:00.000Z"
|
"datetime": "2021-09-01T07:00:00.000Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"symbol": "ADA/USDT",
|
"symbol": "ADA/USDT:USDT",
|
||||||
"fundingRate": -0.000003,
|
"fundingRate": -0.000003,
|
||||||
"timestamp": 1630483200000,
|
"timestamp": 1630483200000,
|
||||||
"datetime": "2021-09-01T08:00:00.000Z"
|
"datetime": "2021-09-01T08:00:00.000Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"symbol": "ADA/USDT",
|
"symbol": "ADA/USDT:USDT",
|
||||||
"fundingRate": 0,
|
"fundingRate": 0,
|
||||||
"timestamp": 1630486800000,
|
"timestamp": 1630486800000,
|
||||||
"datetime": "2021-09-01T09:00:00.000Z"
|
"datetime": "2021-09-01T09:00:00.000Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"symbol": "ADA/USDT",
|
"symbol": "ADA/USDT:USDT",
|
||||||
"fundingRate": 0.000013,
|
"fundingRate": 0.000013,
|
||||||
"timestamp": 1630490400000,
|
"timestamp": 1630490400000,
|
||||||
"datetime": "2021-09-01T10:00:00.000Z"
|
"datetime": "2021-09-01T10:00:00.000Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"symbol": "ADA/USDT",
|
"symbol": "ADA/USDT:USDT",
|
||||||
"fundingRate": 0.000077,
|
"fundingRate": 0.000077,
|
||||||
"timestamp": 1630494000000,
|
"timestamp": 1630494000000,
|
||||||
"datetime": "2021-09-01T11:00:00.000Z"
|
"datetime": "2021-09-01T11:00:00.000Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"symbol": "ADA/USDT",
|
"symbol": "ADA/USDT:USDT",
|
||||||
"fundingRate": 0.000072,
|
"fundingRate": 0.000072,
|
||||||
"timestamp": 1630497600000,
|
"timestamp": 1630497600000,
|
||||||
"datetime": "2021-09-01T12:00:00.000Z"
|
"datetime": "2021-09-01T12:00:00.000Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"symbol": "ADA/USDT",
|
"symbol": "ADA/USDT:USDT",
|
||||||
"fundingRate": 0.000097,
|
"fundingRate": 0.000097,
|
||||||
"timestamp": 1630501200000,
|
"timestamp": 1630501200000,
|
||||||
"datetime": "2021-09-01T13:00:00.000Z"
|
"datetime": "2021-09-01T13:00:00.000Z"
|
||||||
@@ -3091,13 +3091,13 @@ def funding_rate_history_hourly():
|
|||||||
def funding_rate_history_octohourly():
|
def funding_rate_history_octohourly():
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
"symbol": "ADA/USDT",
|
"symbol": "ADA/USDT:USDT",
|
||||||
"fundingRate": -0.000008,
|
"fundingRate": -0.000008,
|
||||||
"timestamp": 1630454400000,
|
"timestamp": 1630454400000,
|
||||||
"datetime": "2021-09-01T00:00:00.000Z"
|
"datetime": "2021-09-01T00:00:00.000Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"symbol": "ADA/USDT",
|
"symbol": "ADA/USDT:USDT",
|
||||||
"fundingRate": -0.000003,
|
"fundingRate": -0.000003,
|
||||||
"timestamp": 1630483200000,
|
"timestamp": 1630483200000,
|
||||||
"datetime": "2021-09-01T08:00:00.000Z"
|
"datetime": "2021-09-01T08:00:00.000Z"
|
||||||
|
|||||||
@@ -4343,11 +4343,11 @@ def test__fetch_and_calculate_funding_fees(
|
|||||||
ex = get_patched_exchange(mocker, default_conf, api_mock, id=exchange)
|
ex = get_patched_exchange(mocker, default_conf, api_mock, id=exchange)
|
||||||
mocker.patch(f'{EXMS}.timeframes', PropertyMock(return_value=['1h', '4h', '8h']))
|
mocker.patch(f'{EXMS}.timeframes', PropertyMock(return_value=['1h', '4h', '8h']))
|
||||||
funding_fees = ex._fetch_and_calculate_funding_fees(
|
funding_fees = ex._fetch_and_calculate_funding_fees(
|
||||||
pair='ADA/USDT', amount=amount, is_short=True, open_date=d1, close_date=d2)
|
pair='ADA/USDT:USDT', amount=amount, is_short=True, open_date=d1, close_date=d2)
|
||||||
assert pytest.approx(funding_fees) == expected_fees
|
assert pytest.approx(funding_fees) == expected_fees
|
||||||
# Fees for Longs are inverted
|
# Fees for Longs are inverted
|
||||||
funding_fees = ex._fetch_and_calculate_funding_fees(
|
funding_fees = ex._fetch_and_calculate_funding_fees(
|
||||||
pair='ADA/USDT', amount=amount, is_short=False, open_date=d1, close_date=d2)
|
pair='ADA/USDT:USDT', amount=amount, is_short=False, open_date=d1, close_date=d2)
|
||||||
assert pytest.approx(funding_fees) == -expected_fees
|
assert pytest.approx(funding_fees) == -expected_fees
|
||||||
|
|
||||||
# Return empty "refresh_latest"
|
# Return empty "refresh_latest"
|
||||||
@@ -4355,7 +4355,7 @@ def test__fetch_and_calculate_funding_fees(
|
|||||||
ex = get_patched_exchange(mocker, default_conf, api_mock, id=exchange)
|
ex = get_patched_exchange(mocker, default_conf, api_mock, id=exchange)
|
||||||
with pytest.raises(ExchangeError, match="Could not find funding rates."):
|
with pytest.raises(ExchangeError, match="Could not find funding rates."):
|
||||||
ex._fetch_and_calculate_funding_fees(
|
ex._fetch_and_calculate_funding_fees(
|
||||||
pair='ADA/USDT', amount=amount, is_short=False, open_date=d1, close_date=d2)
|
pair='ADA/USDT:USDT', amount=amount, is_short=False, open_date=d1, close_date=d2)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('exchange,expected_fees', [
|
@pytest.mark.parametrize('exchange,expected_fees', [
|
||||||
|
|||||||
Reference in New Issue
Block a user