created default_conf_usdt and init_persistence_usdt so that these tests pass: test_handle_stoploss_on_exchange_trailing, test_handle_stoploss_on_exchange_custom_stop, test_update_trade_state_withorderdict

This commit is contained in:
Sam Germain
2021-09-26 10:09:10 -06:00
parent d1e3d48075
commit 6fdcf8cd73
2 changed files with 56 additions and 33 deletions

View File

@@ -289,11 +289,21 @@ def init_persistence(default_conf):
init_db(default_conf['db_url'], default_conf['dry_run'])
@pytest.fixture(scope='function')
def init_persistence_usdt(default_conf_usdt):
init_db(default_conf_usdt['db_url'], default_conf_usdt['dry_run'])
@pytest.fixture(scope="function")
def default_conf(testdatadir):
return get_default_conf(testdatadir)
@pytest.fixture(scope="function")
def default_conf_usdt(testdatadir):
return get_default_conf_usdt(testdatadir)
def get_default_conf(testdatadir):
""" Returns validated configuration suitable for most tests """
configuration = {
@@ -368,6 +378,15 @@ def get_default_conf(testdatadir):
return configuration
def get_default_conf_usdt(testdatadir):
configuration = get_default_conf(testdatadir)
configuration.update({
"stake_amount": 60.0,
"stake_currency": "USDT",
})
return configuration
@pytest.fixture
def update():
_update = Update(0)
@@ -1602,7 +1621,7 @@ def trades_for_order():
'info': {
'id': 34567,
'orderId': 123456,
'price': '0.24544100',
'price': '2.0',
'qty': '8.00000000',
'commission': '0.00800000',
'commissionAsset': 'LTC',
@@ -1811,6 +1830,14 @@ def edge_conf(default_conf):
return conf
@pytest.fixture(scope="function")
def edge_conf_usdt(edge_conf):
edge_conf.update({
"stake_currency": "USDT",
})
return edge_conf
@pytest.fixture
def rpc_balance():
return {
@@ -2049,7 +2076,7 @@ def saved_hyperopt_results():
@pytest.fixture(scope='function')
def limit_buy_order_usdt_open():
return {
'id': 'mocked_limit_buy',
'id': 'mocked_limit_buy_usdt',
'type': 'limit',
'side': 'buy',
'symbol': 'mocked',
@@ -2076,7 +2103,7 @@ def limit_buy_order_usdt(limit_buy_order_usdt_open):
@pytest.fixture
def limit_sell_order_usdt_open():
return {
'id': 'mocked_limit_sell',
'id': 'mocked_limit_sell_usdt',
'type': 'limit',
'side': 'sell',
'pair': 'mocked',