Don't mock full modules

This commit is contained in:
Matthias 2023-03-02 07:07:09 +01:00
parent 38050b5346
commit 5d0e14b564
2 changed files with 5 additions and 5 deletions

View File

@ -1179,7 +1179,7 @@ def test_api_force_entry(botclient, mocker, fee, endpoint):
ftbot.config['force_entry_enable'] = True ftbot.config['force_entry_enable'] = True
fbuy_mock = MagicMock(return_value=None) fbuy_mock = MagicMock(return_value=None)
mocker.patch("freqtrade.rpc.RPC._rpc_force_entry", fbuy_mock) mocker.patch("freqtrade.rpc.rpc.RPC._rpc_force_entry", fbuy_mock)
rc = client_post(client, f"{BASE_URI}/{endpoint}", rc = client_post(client, f"{BASE_URI}/{endpoint}",
data={"pair": "ETH/BTC"}) data={"pair": "ETH/BTC"})
assert_response(rc) assert_response(rc)
@ -1205,7 +1205,7 @@ def test_api_force_entry(botclient, mocker, fee, endpoint):
strategy=CURRENT_TEST_STRATEGY, strategy=CURRENT_TEST_STRATEGY,
trading_mode=TradingMode.SPOT trading_mode=TradingMode.SPOT
)) ))
mocker.patch("freqtrade.rpc.RPC._rpc_force_entry", fbuy_mock) mocker.patch("freqtrade.rpc.rpc.RPC._rpc_force_entry", fbuy_mock)
rc = client_post(client, f"{BASE_URI}/{endpoint}", rc = client_post(client, f"{BASE_URI}/{endpoint}",
data={"pair": "ETH/BTC"}) data={"pair": "ETH/BTC"})

View File

@ -1209,7 +1209,7 @@ def test_force_enter_handle(default_conf, update, mocker) -> None:
mocker.patch('freqtrade.rpc.rpc.CryptoToFiatConverter._find_price', return_value=15000.0) mocker.patch('freqtrade.rpc.rpc.CryptoToFiatConverter._find_price', return_value=15000.0)
fbuy_mock = MagicMock(return_value=None) fbuy_mock = MagicMock(return_value=None)
mocker.patch('freqtrade.rpc.RPC._rpc_force_entry', fbuy_mock) mocker.patch('freqtrade.rpc.rpc.RPC._rpc_force_entry', fbuy_mock)
telegram, freqtradebot, _ = get_telegram_testobject(mocker, default_conf) telegram, freqtradebot, _ = get_telegram_testobject(mocker, default_conf)
patch_get_signal(freqtradebot) patch_get_signal(freqtradebot)
@ -1226,7 +1226,7 @@ def test_force_enter_handle(default_conf, update, mocker) -> None:
# Reset and retry with specified price # Reset and retry with specified price
fbuy_mock = MagicMock(return_value=None) fbuy_mock = MagicMock(return_value=None)
mocker.patch('freqtrade.rpc.RPC._rpc_force_entry', fbuy_mock) mocker.patch('freqtrade.rpc.rpc.RPC._rpc_force_entry', fbuy_mock)
# /forcelong ETH/BTC 0.055 # /forcelong ETH/BTC 0.055
context = MagicMock() context = MagicMock()
context.args = ["ETH/BTC", "0.055"] context.args = ["ETH/BTC", "0.055"]
@ -1255,7 +1255,7 @@ def test_force_enter_no_pair(default_conf, update, mocker) -> None:
mocker.patch('freqtrade.rpc.rpc.CryptoToFiatConverter._find_price', return_value=15000.0) mocker.patch('freqtrade.rpc.rpc.CryptoToFiatConverter._find_price', return_value=15000.0)
fbuy_mock = MagicMock(return_value=None) fbuy_mock = MagicMock(return_value=None)
mocker.patch('freqtrade.rpc.RPC._rpc_force_entry', fbuy_mock) mocker.patch('freqtrade.rpc.rpc.RPC._rpc_force_entry', fbuy_mock)
telegram, freqtradebot, msg_mock = get_telegram_testobject(mocker, default_conf) telegram, freqtradebot, msg_mock = get_telegram_testobject(mocker, default_conf)