Changesets · Branches · Tags · Compare
| Changeset | e045c6a8f6df7a92fe5d2674bc210cc62dd498a97a3b549f5aaed5c7ed365be8 |
|---|---|
| Author | Matthias <xmatthias@outlook.com> · 2021-04-10 14:13 +02:00 |
| Committer | Matthias <xmatthias@outlook.com> · 2021-04-10 14:17 +02:00 |
| Parents | a8d373509c08 |
2 files changed
modified freqtrade/exchange/exchange.py +0 −4
| @@ -662,8 +662,6 @@ | ||
| 662 | 662 | |
| 663 | 663 | @retrier |
| 664 | 664 | def get_balance(self, currency: str) -> float: |
| 665 | - if self._config['dry_run']: | |
| 666 | - return self._config['dry_run_wallet'] | |
| 667 | 665 | |
| 668 | 666 | # ccxt exception is already handled by get_balances |
| 669 | 667 | balances = self.get_balances() |
| @@ -675,8 +673,6 @@ | ||
| 675 | 673 | |
| 676 | 674 | @retrier |
| 677 | 675 | def get_balances(self) -> dict: |
| 678 | - if self._config['dry_run']: | |
| 679 | - return {} | |
| 680 | 676 | |
| 681 | 677 | try: |
| 682 | 678 | balances = self._api.fetch_balance() |
modified tests/exchange/test_exchange.py +0 −15
| @@ -1245,14 +1245,6 @@ | ||
| 1245 | 1245 | assert "timeInForce" not in api_mock.create_order.call_args[0][5] |
| 1246 | 1246 | |
| 1247 | 1247 | |
| 1248 | -def test_get_balance_dry_run(default_conf, mocker): | |
| 1249 | - default_conf['dry_run'] = True | |
| 1250 | - default_conf['dry_run_wallet'] = 999.9 | |
| 1251 | - | |
| 1252 | - exchange = get_patched_exchange(mocker, default_conf) | |
| 1253 | - assert exchange.get_balance(currency='BTC') == 999.9 | |
| 1254 | - | |
| 1255 | - | |
| 1256 | 1248 | @pytest.mark.parametrize("exchange_name", EXCHANGES) |
| 1257 | 1249 | def test_get_balance_prod(default_conf, mocker, exchange_name): |
| 1258 | 1250 | api_mock = MagicMock() |
| @@ -1276,13 +1268,6 @@ | ||
| 1276 | 1268 | exchange.get_balance(currency='BTC') |
| 1277 | 1269 | |
| 1278 | 1270 | |
| 1279 | -@pytest.mark.parametrize("exchange_name", EXCHANGES) | |
| 1280 | -def test_get_balances_dry_run(default_conf, mocker, exchange_name): | |
| 1281 | - default_conf['dry_run'] = True | |
| 1282 | - exchange = get_patched_exchange(mocker, default_conf, id=exchange_name) | |
| 1283 | - assert exchange.get_balances() == {} | |
| 1284 | - | |
| 1285 | - | |
| 1286 | 1271 | @pytest.mark.parametrize("exchange_name", EXCHANGES) |
| 1287 | 1272 | def test_get_balances_prod(default_conf, mocker, exchange_name): |
| 1288 | 1273 | balance_item = { |