mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-14 04:03:55 +00:00
chore: fix mote A violations in tests and scripts
This commit is contained in:
parent
4a4e6bc952
commit
1e287de589
|
@ -133,8 +133,8 @@ def test_FtRestClient_call_invalid(caplog):
|
||||||
)
|
)
|
||||||
def test_FtRestClient_call_explicit_methods(method, args, kwargs):
|
def test_FtRestClient_call_explicit_methods(method, args, kwargs):
|
||||||
client, mock = get_rest_client()
|
client, mock = get_rest_client()
|
||||||
exec = getattr(client, method)
|
executor = getattr(client, method)
|
||||||
exec(*args, **kwargs)
|
executor(*args, **kwargs)
|
||||||
assert mock.call_count == 1
|
assert mock.call_count == 1
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -172,10 +172,10 @@ class ClientProtocol:
|
||||||
|
|
||||||
return readable_timedelta(time_delta)
|
return readable_timedelta(time_delta)
|
||||||
|
|
||||||
async def _handle_whitelist(self, name, type, data):
|
async def _handle_whitelist(self, name, msgtype, data):
|
||||||
self.logger.info(data)
|
self.logger.info(data)
|
||||||
|
|
||||||
async def _handle_analyzed_df(self, name, type, data):
|
async def _handle_analyzed_df(self, name, msgtype, data):
|
||||||
key, la, df = data["key"], data["la"], data["df"]
|
key, la, df = data["key"], data["la"], data["df"]
|
||||||
|
|
||||||
if not df.empty:
|
if not df.empty:
|
||||||
|
@ -189,8 +189,8 @@ class ClientProtocol:
|
||||||
else:
|
else:
|
||||||
self.logger.info("Empty DataFrame")
|
self.logger.info("Empty DataFrame")
|
||||||
|
|
||||||
async def _handle_default(self, name, type, data):
|
async def _handle_default(self, name, msgtype, data):
|
||||||
self.logger.info("Unknown message of type {type} received...")
|
self.logger.info("Unknown message of type {msgtype} received...")
|
||||||
self.logger.info(data)
|
self.logger.info(data)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ def test_datahandler_ohlcv_regex(filename, pair, timeframe, candletype):
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"input,expected",
|
"pair,expected",
|
||||||
[
|
[
|
||||||
("XMR_USDT", "XMR/USDT"),
|
("XMR_USDT", "XMR/USDT"),
|
||||||
("BTC_USDT", "BTC/USDT"),
|
("BTC_USDT", "BTC/USDT"),
|
||||||
|
@ -95,8 +95,8 @@ def test_datahandler_ohlcv_regex(filename, pair, timeframe, candletype):
|
||||||
("UNITTEST_USDT", "UNITTEST/USDT"),
|
("UNITTEST_USDT", "UNITTEST/USDT"),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_rebuild_pair_from_filename(input, expected):
|
def test_rebuild_pair_from_filename(pair, expected):
|
||||||
assert IDataHandler.rebuild_pair_from_filename(input) == expected
|
assert IDataHandler.rebuild_pair_from_filename(pair) == expected
|
||||||
|
|
||||||
|
|
||||||
def test_datahandler_ohlcv_get_available_data(testdatadir):
|
def test_datahandler_ohlcv_get_available_data(testdatadir):
|
||||||
|
|
|
@ -12,7 +12,7 @@ from tests.exchange.test_exchange import ccxt_exceptionhandlers
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"side,type,time_in_force,expected",
|
"side,order_type,time_in_force,expected",
|
||||||
[
|
[
|
||||||
("buy", "limit", "gtc", {"timeInForce": "GTC"}),
|
("buy", "limit", "gtc", {"timeInForce": "GTC"}),
|
||||||
("buy", "limit", "IOC", {"timeInForce": "IOC"}),
|
("buy", "limit", "IOC", {"timeInForce": "IOC"}),
|
||||||
|
@ -22,9 +22,9 @@ from tests.exchange.test_exchange import ccxt_exceptionhandlers
|
||||||
("sell", "market", "PO", {}),
|
("sell", "market", "PO", {}),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test__get_params_binance(default_conf, mocker, side, type, time_in_force, expected):
|
def test__get_params_binance(default_conf, mocker, side, order_type, time_in_force, expected):
|
||||||
exchange = get_patched_exchange(mocker, default_conf, id="binance")
|
exchange = get_patched_exchange(mocker, default_conf, id="binance")
|
||||||
assert exchange._get_params(side, type, 1, False, time_in_force) == expected
|
assert exchange._get_params(side, order_type, 1, False, time_in_force) == expected
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("trademode", [TradingMode.FUTURES, TradingMode.SPOT])
|
@pytest.mark.parametrize("trademode", [TradingMode.FUTURES, TradingMode.SPOT])
|
||||||
|
|
|
@ -4,7 +4,7 @@ from freqtrade.enums import CandleType
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"input,expected",
|
"candle_type,expected",
|
||||||
[
|
[
|
||||||
("", CandleType.SPOT),
|
("", CandleType.SPOT),
|
||||||
("spot", CandleType.SPOT),
|
("spot", CandleType.SPOT),
|
||||||
|
@ -17,17 +17,17 @@ from freqtrade.enums import CandleType
|
||||||
("premiumIndex", CandleType.PREMIUMINDEX),
|
("premiumIndex", CandleType.PREMIUMINDEX),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_CandleType_from_string(input, expected):
|
def test_CandleType_from_string(candle_type, expected):
|
||||||
assert CandleType.from_string(input) == expected
|
assert CandleType.from_string(candle_type) == expected
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"input,expected",
|
"candle_type,expected",
|
||||||
[
|
[
|
||||||
("futures", CandleType.FUTURES),
|
("futures", CandleType.FUTURES),
|
||||||
("spot", CandleType.SPOT),
|
("spot", CandleType.SPOT),
|
||||||
("margin", CandleType.SPOT),
|
("margin", CandleType.SPOT),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_CandleType_get_default(input, expected):
|
def test_CandleType_get_default(candle_type, expected):
|
||||||
assert CandleType.get_default(input) == expected
|
assert CandleType.get_default(candle_type) == expected
|
||||||
|
|
Loading…
Reference in New Issue
Block a user