dont use hardcoded bittrex for tests

This commit is contained in:
Samuel Husso 2018-03-09 09:24:45 +02:00
parent 018dd4cf6a
commit 872bbd1140
2 changed files with 13 additions and 13 deletions

View File

@ -49,11 +49,11 @@ def default_conf():
"key": "key", "key": "key",
"secret": "secret", "secret": "secret",
"pair_whitelist": [ "pair_whitelist": [
"BTC_ETH", "ETH/BTC",
"BTC_TKN", "TKN/BTC",
"BTC_TRST", "TRST/BTC",
"BTC_SWT", "SWT/BTC",
"BTC_BCC" "BCC/BTC"
] ]
}, },
"telegram": { "telegram": {

View File

@ -6,7 +6,7 @@ import logging
import uuid import uuid
from shutil import copyfile from shutil import copyfile
from freqtrade import exchange, optimize from freqtrade import exchange, optimize
from freqtrade.exchange import Bittrex from freqtrade.exchange import init as exchange_init
from freqtrade.optimize.__init__ import make_testdata_path, download_pairs,\ from freqtrade.optimize.__init__ import make_testdata_path, download_pairs,\
download_backtesting_testdata, load_tickerdata_file, trim_tickerlist, file_dump_json download_backtesting_testdata, load_tickerdata_file, trim_tickerlist, file_dump_json
@ -49,7 +49,7 @@ def test_load_data_30min_ticker(default_conf, ticker_history, mocker, caplog):
mocker.patch('freqtrade.optimize.get_ticker_history', return_value=ticker_history) mocker.patch('freqtrade.optimize.get_ticker_history', return_value=ticker_history)
mocker.patch.dict('freqtrade.main._CONF', default_conf) mocker.patch.dict('freqtrade.main._CONF', default_conf)
exchange._API = Bittrex({'key': '', 'secret': ''}) exchange._API = exchange_init({'key': '', 'secret': ''})
file = 'freqtrade/tests/testdata/BTC_UNITTEST-30.json' file = 'freqtrade/tests/testdata/BTC_UNITTEST-30.json'
_backup_file(file, copy_file=True) _backup_file(file, copy_file=True)
@ -65,7 +65,7 @@ def test_load_data_5min_ticker(default_conf, ticker_history, mocker, caplog):
mocker.patch('freqtrade.optimize.get_ticker_history', return_value=ticker_history) mocker.patch('freqtrade.optimize.get_ticker_history', return_value=ticker_history)
mocker.patch.dict('freqtrade.main._CONF', default_conf) mocker.patch.dict('freqtrade.main._CONF', default_conf)
exchange._API = Bittrex({'key': '', 'secret': ''}) exchange._API = exchange_init({'key': '', 'secret': ''})
file = 'freqtrade/tests/testdata/BTC_ETH-5.json' file = 'freqtrade/tests/testdata/BTC_ETH-5.json'
_backup_file(file, copy_file=True) _backup_file(file, copy_file=True)
@ -81,7 +81,7 @@ def test_load_data_1min_ticker(default_conf, ticker_history, mocker, caplog):
mocker.patch('freqtrade.optimize.get_ticker_history', return_value=ticker_history) mocker.patch('freqtrade.optimize.get_ticker_history', return_value=ticker_history)
mocker.patch.dict('freqtrade.main._CONF', default_conf) mocker.patch.dict('freqtrade.main._CONF', default_conf)
exchange._API = Bittrex({'key': '', 'secret': ''}) exchange._API = exchange_init({'key': '', 'secret': ''})
file = 'freqtrade/tests/testdata/BTC_ETH-1.json' file = 'freqtrade/tests/testdata/BTC_ETH-1.json'
_backup_file(file, copy_file=True) _backup_file(file, copy_file=True)
@ -97,7 +97,7 @@ def test_load_data_with_new_pair_1min(default_conf, ticker_history, mocker, capl
mocker.patch('freqtrade.optimize.get_ticker_history', return_value=ticker_history) mocker.patch('freqtrade.optimize.get_ticker_history', return_value=ticker_history)
mocker.patch.dict('freqtrade.main._CONF', default_conf) mocker.patch.dict('freqtrade.main._CONF', default_conf)
exchange._API = Bittrex({'key': '', 'secret': ''}) exchange._API = exchange_init({'key': '', 'secret': ''})
file = 'freqtrade/tests/testdata/BTC_MEME-1.json' file = 'freqtrade/tests/testdata/BTC_MEME-1.json'
_backup_file(file) _backup_file(file)
@ -116,7 +116,7 @@ def test_testdata_path():
def test_download_pairs(default_conf, ticker_history, mocker): def test_download_pairs(default_conf, ticker_history, mocker):
mocker.patch('freqtrade.optimize.__init__.get_ticker_history', return_value=ticker_history) mocker.patch('freqtrade.optimize.__init__.get_ticker_history', return_value=ticker_history)
mocker.patch.dict('freqtrade.main._CONF', default_conf) mocker.patch.dict('freqtrade.main._CONF', default_conf)
exchange._API = Bittrex({'key': '', 'secret': ''}) exchange._API = exchange_init({'key': '', 'secret': ''})
file1_1 = 'freqtrade/tests/testdata/BTC_MEME-1.json' file1_1 = 'freqtrade/tests/testdata/BTC_MEME-1.json'
file1_5 = 'freqtrade/tests/testdata/BTC_MEME-5.json' file1_5 = 'freqtrade/tests/testdata/BTC_MEME-5.json'
@ -158,7 +158,7 @@ def test_download_pairs_exception(default_conf, ticker_history, mocker, caplog):
mocker.patch('freqtrade.optimize.__init__.download_backtesting_testdata', mocker.patch('freqtrade.optimize.__init__.download_backtesting_testdata',
side_effect=BaseException('File Error')) side_effect=BaseException('File Error'))
mocker.patch.dict('freqtrade.main._CONF', default_conf) mocker.patch.dict('freqtrade.main._CONF', default_conf)
exchange._API = Bittrex({'key': '', 'secret': ''}) exchange._API = exchange_init({'key': '', 'secret': ''})
file1_1 = 'freqtrade/tests/testdata/BTC_MEME-1.json' file1_1 = 'freqtrade/tests/testdata/BTC_MEME-1.json'
file1_5 = 'freqtrade/tests/testdata/BTC_MEME-5.json' file1_5 = 'freqtrade/tests/testdata/BTC_MEME-5.json'
@ -177,7 +177,7 @@ def test_download_pairs_exception(default_conf, ticker_history, mocker, caplog):
def test_download_backtesting_testdata(default_conf, ticker_history, mocker): def test_download_backtesting_testdata(default_conf, ticker_history, mocker):
mocker.patch('freqtrade.optimize.__init__.get_ticker_history', return_value=ticker_history) mocker.patch('freqtrade.optimize.__init__.get_ticker_history', return_value=ticker_history)
mocker.patch.dict('freqtrade.main._CONF', default_conf) mocker.patch.dict('freqtrade.main._CONF', default_conf)
exchange._API = Bittrex({'key': '', 'secret': ''}) exchange._API = exchange_init({'key': '', 'secret': ''})
# Download a 1 min ticker file # Download a 1 min ticker file
file1 = 'freqtrade/tests/testdata/BTC_XEL-1.json' file1 = 'freqtrade/tests/testdata/BTC_XEL-1.json'