Adjust tests to use correctly trimmed amount

This commit is contained in:
Matthias
2020-07-15 20:51:52 +02:00
parent 3721736aaf
commit 98f2e79f27
5 changed files with 24 additions and 24 deletions

View File

@@ -79,8 +79,8 @@ def test_rpc_trade_status(default_conf, ticker, fee, mocker) -> None:
'open_rate': 1.098e-05,
'close_rate': None,
'current_rate': 1.099e-05,
'amount': 91.07468124,
'amount_requested': 91.07468124,
'amount': 91.07468123,
'amount_requested': 91.07468123,
'stake_amount': 0.001,
'close_profit': None,
'close_profit_pct': None,
@@ -143,8 +143,8 @@ def test_rpc_trade_status(default_conf, ticker, fee, mocker) -> None:
'open_rate': 1.098e-05,
'close_rate': None,
'current_rate': ANY,
'amount': 91.07468124,
'amount_requested': 91.07468124,
'amount': 91.07468123,
'amount_requested': 91.07468123,
'stake_amount': 0.001,
'close_profit': None,
'close_profit_pct': None,

View File

@@ -519,8 +519,8 @@ def test_api_status(botclient, mocker, ticker, fee, markets):
rc = client_get(client, f"{BASE_URI}/status")
assert_response(rc)
assert len(rc.json) == 1
assert rc.json == [{'amount': 91.07468124,
'amount_requested': 91.07468124,
assert rc.json == [{'amount': 91.07468123,
'amount_requested': 91.07468123,
'base_currency': 'BTC',
'close_date': None,
'close_date_hum': None,
@@ -696,7 +696,7 @@ def test_api_forcebuy(botclient, mocker, fee):
'min_rate': None,
'open_order_id': '123456',
'open_rate_requested': None,
'open_trade_price': 0.2460546025,
'open_trade_price': 0.24605460,
'sell_reason': None,
'sell_order_status': None,
'strategy': None,

View File

@@ -690,7 +690,7 @@ def test_reload_config_handle(default_conf, update, mocker) -> None:
assert 'reloading config' in msg_mock.call_args_list[0][0][0]
def test_forcesell_handle(default_conf, update, ticker, fee,
def test_telegram_forcesell_handle(default_conf, update, ticker, fee,
ticker_sell_up, mocker) -> None:
mocker.patch('freqtrade.rpc.rpc.CryptoToFiatConverter._find_price', return_value=15000.0)
rpc_mock = mocker.patch('freqtrade.rpc.telegram.Telegram.send_msg', MagicMock())
@@ -729,7 +729,7 @@ def test_forcesell_handle(default_conf, update, ticker, fee,
'pair': 'ETH/BTC',
'gain': 'profit',
'limit': 1.173e-05,
'amount': 91.07468123861567,
'amount': 91.07468123,
'order_type': 'limit',
'open_rate': 1.098e-05,
'current_rate': 1.173e-05,
@@ -743,8 +743,8 @@ def test_forcesell_handle(default_conf, update, ticker, fee,
} == last_msg
def test_forcesell_down_handle(default_conf, update, ticker, fee,
ticker_sell_down, mocker) -> None:
def test_telegram_forcesell_down_handle(default_conf, update, ticker, fee,
ticker_sell_down, mocker) -> None:
mocker.patch('freqtrade.rpc.fiat_convert.CryptoToFiatConverter._find_price',
return_value=15000.0)
rpc_mock = mocker.patch('freqtrade.rpc.telegram.Telegram.send_msg', MagicMock())
@@ -788,7 +788,7 @@ def test_forcesell_down_handle(default_conf, update, ticker, fee,
'pair': 'ETH/BTC',
'gain': 'loss',
'limit': 1.043e-05,
'amount': 91.07468123861567,
'amount': 91.07468123,
'order_type': 'limit',
'open_rate': 1.098e-05,
'current_rate': 1.043e-05,
@@ -836,7 +836,7 @@ def test_forcesell_all_handle(default_conf, update, ticker, fee, mocker) -> None
'pair': 'ETH/BTC',
'gain': 'loss',
'limit': 1.099e-05,
'amount': 91.07468123861567,
'amount': 91.07468123,
'order_type': 'limit',
'open_rate': 1.098e-05,
'current_rate': 1.099e-05,