fix broken tests

This commit is contained in:
Ork Blutt 2020-04-06 15:49:24 +02:00
parent 815660c070
commit c1f9595086
2 changed files with 59 additions and 4 deletions

View File

@ -444,7 +444,22 @@ def test_api_status(botclient, mocker, ticker, fee, markets):
'stake_amount': 0.001, 'stake_amount': 0.001,
'stop_loss': 0.0, 'stop_loss': 0.0,
'stop_loss_pct': None, 'stop_loss_pct': None,
'trade_id': 1}] 'trade_id': 1,
'close_rate_requested': None,
'current_profit': -0.41,
'current_rate': 1.099e-05,
'fee_close': 0.0025,
'fee_open': 0.0025,
'open_date': ANY,
'is_open': True,
'max_rate': 0.0,
'min_rate': None,
'open_order_id': ANY,
'open_rate_requested': 1.098e-05,
'open_trade_price': 0.0010025,
'sell_reason': None,
'strategy': 'DefaultStrategy',
'ticker_interval': 5}]
def test_api_version(botclient): def test_api_version(botclient):
@ -533,7 +548,21 @@ def test_api_forcebuy(botclient, mocker, fee):
'stake_amount': 1, 'stake_amount': 1,
'stop_loss': None, 'stop_loss': None,
'stop_loss_pct': None, 'stop_loss_pct': None,
'trade_id': None} 'trade_id': None,
'close_profit': None,
'close_rate_requested': None,
'fee_close': 0.0025,
'fee_open': 0.0025,
'is_open': False,
'max_rate': None,
'min_rate': None,
'open_order_id': '123456',
'open_rate_requested': None,
'open_trade_price': 0.2460546025,
'sell_reason': None,
'strategy': None,
'ticker_interval': None
}
def test_api_forcesell(botclient, mocker, ticker, fee, markets): def test_api_forcesell(botclient, mocker, ticker, fee, markets):

View File

@ -777,18 +777,31 @@ def test_to_json(default_conf, fee):
assert result == {'trade_id': None, assert result == {'trade_id': None,
'pair': 'ETH/BTC', 'pair': 'ETH/BTC',
'is_open': None,
'open_date_hum': '2 hours ago', 'open_date_hum': '2 hours ago',
'open_date': trade.open_date.strftime("%Y-%m-%d %H:%M:%S"), 'open_date': trade.open_date.strftime("%Y-%m-%d %H:%M:%S"),
'open_order_id': 'dry_run_buy_12345',
'close_date_hum': None, 'close_date_hum': None,
'close_date': None, 'close_date': None,
'open_rate': 0.123, 'open_rate': 0.123,
'open_rate_requested': None,
'open_trade_price': 15.1668225,
'fee_close': 0.0025,
'fee_open': 0.0025,
'close_rate': None, 'close_rate': None,
'close_rate_requested': None,
'amount': 123.0, 'amount': 123.0,
'stake_amount': 0.001, 'stake_amount': 0.001,
'close_profit': None,
'sell_reason': None,
'stop_loss': None, 'stop_loss': None,
'stop_loss_pct': None, 'stop_loss_pct': None,
'initial_stop_loss': None, 'initial_stop_loss': None,
'initial_stop_loss_pct': None} 'initial_stop_loss_pct': None,
'min_rate': None,
'max_rate': None,
'strategy': None,
'ticker_interval': None}
# Simulate dry_run entries # Simulate dry_run entries
trade = Trade( trade = Trade(
@ -819,7 +832,20 @@ def test_to_json(default_conf, fee):
'stop_loss': None, 'stop_loss': None,
'stop_loss_pct': None, 'stop_loss_pct': None,
'initial_stop_loss': None, 'initial_stop_loss': None,
'initial_stop_loss_pct': None} 'initial_stop_loss_pct': None,
'close_profit': None,
'close_rate_requested': None,
'fee_close': 0.0025,
'fee_open': 0.0025,
'is_open': None,
'max_rate': None,
'min_rate': None,
'open_order_id': None,
'open_rate_requested': None,
'open_trade_price': 12.33075,
'sell_reason': None,
'strategy': None,
'ticker_interval': None}
def test_stoploss_reinitialization(default_conf, fee): def test_stoploss_reinitialization(default_conf, fee):