mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-14 04:03:55 +00:00
test wallet when api return changes
This commit is contained in:
parent
5b68940213
commit
aeb372c2f0
|
@ -26,7 +26,32 @@ def test_sync_wallet_at_boot(mocker, default_conf):
|
||||||
assert freqtrade.wallets.wallets['BNT'].free == 1.0
|
assert freqtrade.wallets.wallets['BNT'].free == 1.0
|
||||||
assert freqtrade.wallets.wallets['BNT'].used == 2.0
|
assert freqtrade.wallets.wallets['BNT'].used == 2.0
|
||||||
assert freqtrade.wallets.wallets['BNT'].total == 3.0
|
assert freqtrade.wallets.wallets['BNT'].total == 3.0
|
||||||
|
|
||||||
assert freqtrade.wallets.wallets['GAS'].free == 0.260739
|
assert freqtrade.wallets.wallets['GAS'].free == 0.260739
|
||||||
assert freqtrade.wallets.wallets['GAS'].used == 0.0
|
assert freqtrade.wallets.wallets['GAS'].used == 0.0
|
||||||
assert freqtrade.wallets.wallets['GAS'].total == 0.260739
|
assert freqtrade.wallets.wallets['GAS'].total == 0.260739
|
||||||
|
|
||||||
|
mocker.patch.multiple(
|
||||||
|
'freqtrade.exchange.Exchange',
|
||||||
|
get_balances=MagicMock(return_value={
|
||||||
|
"BNT": {
|
||||||
|
"free": 1.2,
|
||||||
|
"used": 1.9,
|
||||||
|
"total": 3.5
|
||||||
|
},
|
||||||
|
"GAS": {
|
||||||
|
"free": 0.270739,
|
||||||
|
"used": 0.1,
|
||||||
|
"total": 0.260439
|
||||||
|
},
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
freqtrade.wallets.update()
|
||||||
|
|
||||||
|
assert len(freqtrade.wallets.wallets) == 2
|
||||||
|
assert freqtrade.wallets.wallets['BNT'].free == 1.2
|
||||||
|
assert freqtrade.wallets.wallets['BNT'].used == 1.9
|
||||||
|
assert freqtrade.wallets.wallets['BNT'].total == 3.5
|
||||||
|
assert freqtrade.wallets.wallets['GAS'].free == 0.270739
|
||||||
|
assert freqtrade.wallets.wallets['GAS'].used == 0.1
|
||||||
|
assert freqtrade.wallets.wallets['GAS'].total == 0.260439
|
||||||
|
|
Loading…
Reference in New Issue
Block a user