Renamed example config files so they are .json so that syntax highlighting is all correct. Explicitly listed each one in .gitignore to prevent a real config file from being uploaded accidently
This commit is contained in:
parent
a261b188da
commit
362436f7d2
12
.github/workflows/ci.yml
vendored
12
.github/workflows/ci.yml
vendored
@ -79,13 +79,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Backtesting
|
- name: Backtesting
|
||||||
run: |
|
run: |
|
||||||
cp config_bittrex.json.example config.json
|
cp config_examples/config_bittrex.example.json config.json
|
||||||
freqtrade create-userdir --userdir user_data
|
freqtrade create-userdir --userdir user_data
|
||||||
freqtrade backtesting --datadir tests/testdata --strategy SampleStrategy
|
freqtrade backtesting --datadir tests/testdata --strategy SampleStrategy
|
||||||
|
|
||||||
- name: Hyperopt
|
- name: Hyperopt
|
||||||
run: |
|
run: |
|
||||||
cp config_bittrex.json.example config.json
|
cp config_examples/config_bittrex.example.json config.json
|
||||||
freqtrade create-userdir --userdir user_data
|
freqtrade create-userdir --userdir user_data
|
||||||
freqtrade hyperopt --datadir tests/testdata -e 5 --strategy SampleStrategy --hyperopt SampleHyperOpt --hyperopt-loss SharpeHyperOptLossDaily --print-all
|
freqtrade hyperopt --datadir tests/testdata -e 5 --strategy SampleStrategy --hyperopt SampleHyperOpt --hyperopt-loss SharpeHyperOptLossDaily --print-all
|
||||||
|
|
||||||
@ -172,13 +172,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Backtesting
|
- name: Backtesting
|
||||||
run: |
|
run: |
|
||||||
cp config_bittrex.json.example config.json
|
cp config_examples/config_bittrex.example.json config.json
|
||||||
freqtrade create-userdir --userdir user_data
|
freqtrade create-userdir --userdir user_data
|
||||||
freqtrade backtesting --datadir tests/testdata --strategy SampleStrategy
|
freqtrade backtesting --datadir tests/testdata --strategy SampleStrategy
|
||||||
|
|
||||||
- name: Hyperopt
|
- name: Hyperopt
|
||||||
run: |
|
run: |
|
||||||
cp config_bittrex.json.example config.json
|
cp config_examples/config_bittrex.example.json config.json
|
||||||
freqtrade create-userdir --userdir user_data
|
freqtrade create-userdir --userdir user_data
|
||||||
freqtrade hyperopt --datadir tests/testdata -e 5 --strategy SampleStrategy --hyperopt SampleHyperOpt --hyperopt-loss SharpeHyperOptLossDaily --print-all
|
freqtrade hyperopt --datadir tests/testdata -e 5 --strategy SampleStrategy --hyperopt SampleHyperOpt --hyperopt-loss SharpeHyperOptLossDaily --print-all
|
||||||
|
|
||||||
@ -239,13 +239,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Backtesting
|
- name: Backtesting
|
||||||
run: |
|
run: |
|
||||||
cp config_bittrex.json.example config.json
|
cp config_examples/config_bittrex.example.json config.json
|
||||||
freqtrade create-userdir --userdir user_data
|
freqtrade create-userdir --userdir user_data
|
||||||
freqtrade backtesting --datadir tests/testdata --strategy SampleStrategy
|
freqtrade backtesting --datadir tests/testdata --strategy SampleStrategy
|
||||||
|
|
||||||
- name: Hyperopt
|
- name: Hyperopt
|
||||||
run: |
|
run: |
|
||||||
cp config_bittrex.json.example config.json
|
cp config_examples/config_bittrex.example.json config.json
|
||||||
freqtrade create-userdir --userdir user_data
|
freqtrade create-userdir --userdir user_data
|
||||||
freqtrade hyperopt --datadir tests/testdata -e 5 --strategy SampleStrategy --hyperopt SampleHyperOpt --hyperopt-loss SharpeHyperOptLossDaily --print-all
|
freqtrade hyperopt --datadir tests/testdata -e 5 --strategy SampleStrategy --hyperopt SampleHyperOpt --hyperopt-loss SharpeHyperOptLossDaily --print-all
|
||||||
|
|
||||||
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -95,3 +95,8 @@ target/
|
|||||||
|
|
||||||
#exceptions
|
#exceptions
|
||||||
!*.gitkeep
|
!*.gitkeep
|
||||||
|
!config_examples/config_binance.example.json
|
||||||
|
!config_examples/config_bittrex.example.json
|
||||||
|
!config_examples/config_ftx.example.json
|
||||||
|
!config_examples/config_full.example.json
|
||||||
|
!config_examples/config_kraken.example.json
|
||||||
|
@ -26,12 +26,12 @@ jobs:
|
|||||||
# - coveralls || true
|
# - coveralls || true
|
||||||
name: pytest
|
name: pytest
|
||||||
- script:
|
- script:
|
||||||
- cp config_bittrex.json.example config.json
|
- cp config_examples/config_bittrex.example.json config.json
|
||||||
- freqtrade create-userdir --userdir user_data
|
- freqtrade create-userdir --userdir user_data
|
||||||
- freqtrade backtesting --datadir tests/testdata --strategy SampleStrategy
|
- freqtrade backtesting --datadir tests/testdata --strategy SampleStrategy
|
||||||
name: backtest
|
name: backtest
|
||||||
- script:
|
- script:
|
||||||
- cp config_bittrex.json.example config.json
|
- cp config_examples/config_bittrex.example.json config.json
|
||||||
- freqtrade create-userdir --userdir user_data
|
- freqtrade create-userdir --userdir user_data
|
||||||
- freqtrade hyperopt --datadir tests/testdata -e 5 --strategy SampleStrategy --hyperopt SampleHyperOpt --hyperopt-loss SharpeHyperOptLossDaily
|
- freqtrade hyperopt --datadir tests/testdata -e 5 --strategy SampleStrategy --hyperopt SampleHyperOpt --hyperopt-loss SharpeHyperOptLossDaily
|
||||||
name: hyperopt
|
name: hyperopt
|
||||||
|
@ -52,7 +52,7 @@ docker build --cache-from freqtrade:${TAG} --build-arg sourceimage=${TAG} -t fre
|
|||||||
docker tag freqtrade:$TAG_PLOT ${IMAGE_NAME}:$TAG_PLOT
|
docker tag freqtrade:$TAG_PLOT ${IMAGE_NAME}:$TAG_PLOT
|
||||||
|
|
||||||
# Run backtest
|
# Run backtest
|
||||||
docker run --rm -v $(pwd)/config_bittrex.json.example:/freqtrade/config.json:ro -v $(pwd)/tests:/tests freqtrade:${TAG} backtesting --datadir /tests/testdata --strategy-path /tests/strategy/strats/ --strategy DefaultStrategy
|
docker run --rm -v $(pwd)/config_examples/config_bittrex.example.json:/freqtrade/config.json:ro -v $(pwd)/tests:/tests freqtrade:${TAG} backtesting --datadir /tests/testdata --strategy-path /tests/strategy/strats/ --strategy DefaultStrategy
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "failed running backtest"
|
echo "failed running backtest"
|
||||||
|
@ -556,7 +556,7 @@ You should also make sure to read the [Exchanges](exchanges.md) section of the d
|
|||||||
|
|
||||||
To use a proxy with freqtrade, add the kwarg `"aiohttp_trust_env"=true` to the `"ccxt_async_kwargs"` dict in the exchange section of the configuration.
|
To use a proxy with freqtrade, add the kwarg `"aiohttp_trust_env"=true` to the `"ccxt_async_kwargs"` dict in the exchange section of the configuration.
|
||||||
|
|
||||||
An example for this can be found in `config_full.json.example`
|
An example for this can be found in `config_examples/config_full.example.json`
|
||||||
|
|
||||||
``` json
|
``` json
|
||||||
"ccxt_async_config": {
|
"ccxt_async_config": {
|
||||||
|
@ -26,7 +26,7 @@ from tests.conftest_trades import MOCK_TRADE_COUNT
|
|||||||
|
|
||||||
def test_setup_utils_configuration():
|
def test_setup_utils_configuration():
|
||||||
args = [
|
args = [
|
||||||
'list-exchanges', '--config', 'config_bittrex.json.example',
|
'list-exchanges', '--config', 'config_examples/config_bittrex.example.json',
|
||||||
]
|
]
|
||||||
|
|
||||||
config = setup_utils_configuration(get_args(args), RunMode.OTHER)
|
config = setup_utils_configuration(get_args(args), RunMode.OTHER)
|
||||||
@ -45,7 +45,7 @@ def test_start_trading_fail(mocker, caplog):
|
|||||||
exitmock = mocker.patch("freqtrade.worker.Worker.exit", MagicMock())
|
exitmock = mocker.patch("freqtrade.worker.Worker.exit", MagicMock())
|
||||||
args = [
|
args = [
|
||||||
'trade',
|
'trade',
|
||||||
'-c', 'config_bittrex.json.example'
|
'-c', 'config_examples/config_bittrex.example.json'
|
||||||
]
|
]
|
||||||
start_trading(get_args(args))
|
start_trading(get_args(args))
|
||||||
assert exitmock.call_count == 1
|
assert exitmock.call_count == 1
|
||||||
@ -127,10 +127,10 @@ def test_list_timeframes(mocker, capsys):
|
|||||||
match=r"This command requires a configured exchange.*"):
|
match=r"This command requires a configured exchange.*"):
|
||||||
start_list_timeframes(pargs)
|
start_list_timeframes(pargs)
|
||||||
|
|
||||||
# Test with --config config_bittrex.json.example
|
# Test with --config config_examples/config_bittrex.example.json
|
||||||
args = [
|
args = [
|
||||||
"list-timeframes",
|
"list-timeframes",
|
||||||
'--config', 'config_bittrex.json.example',
|
'--config', 'config_examples/config_bittrex.example.json',
|
||||||
]
|
]
|
||||||
start_list_timeframes(get_args(args))
|
start_list_timeframes(get_args(args))
|
||||||
captured = capsys.readouterr()
|
captured = capsys.readouterr()
|
||||||
@ -174,7 +174,7 @@ def test_list_timeframes(mocker, capsys):
|
|||||||
# Test with --one-column
|
# Test with --one-column
|
||||||
args = [
|
args = [
|
||||||
"list-timeframes",
|
"list-timeframes",
|
||||||
'--config', 'config_bittrex.json.example',
|
'--config', 'config_examples/config_bittrex.example.json',
|
||||||
"--one-column",
|
"--one-column",
|
||||||
]
|
]
|
||||||
start_list_timeframes(get_args(args))
|
start_list_timeframes(get_args(args))
|
||||||
@ -214,10 +214,10 @@ def test_list_markets(mocker, markets, capsys):
|
|||||||
match=r"This command requires a configured exchange.*"):
|
match=r"This command requires a configured exchange.*"):
|
||||||
start_list_markets(pargs, False)
|
start_list_markets(pargs, False)
|
||||||
|
|
||||||
# Test with --config config_bittrex.json.example
|
# Test with --config config_examples/config_bittrex.example.json
|
||||||
args = [
|
args = [
|
||||||
"list-markets",
|
"list-markets",
|
||||||
'--config', 'config_bittrex.json.example',
|
'--config', 'config_examples/config_bittrex.example.json',
|
||||||
"--print-list",
|
"--print-list",
|
||||||
]
|
]
|
||||||
start_list_markets(get_args(args), False)
|
start_list_markets(get_args(args), False)
|
||||||
@ -244,7 +244,7 @@ def test_list_markets(mocker, markets, capsys):
|
|||||||
# Test with --all: all markets
|
# Test with --all: all markets
|
||||||
args = [
|
args = [
|
||||||
"list-markets", "--all",
|
"list-markets", "--all",
|
||||||
'--config', 'config_bittrex.json.example',
|
'--config', 'config_examples/config_bittrex.example.json',
|
||||||
"--print-list",
|
"--print-list",
|
||||||
]
|
]
|
||||||
start_list_markets(get_args(args), False)
|
start_list_markets(get_args(args), False)
|
||||||
@ -257,7 +257,7 @@ def test_list_markets(mocker, markets, capsys):
|
|||||||
# Test list-pairs subcommand: active pairs
|
# Test list-pairs subcommand: active pairs
|
||||||
args = [
|
args = [
|
||||||
"list-pairs",
|
"list-pairs",
|
||||||
'--config', 'config_bittrex.json.example',
|
'--config', 'config_examples/config_bittrex.example.json',
|
||||||
"--print-list",
|
"--print-list",
|
||||||
]
|
]
|
||||||
start_list_markets(get_args(args), True)
|
start_list_markets(get_args(args), True)
|
||||||
@ -269,7 +269,7 @@ def test_list_markets(mocker, markets, capsys):
|
|||||||
# Test list-pairs subcommand with --all: all pairs
|
# Test list-pairs subcommand with --all: all pairs
|
||||||
args = [
|
args = [
|
||||||
"list-pairs", "--all",
|
"list-pairs", "--all",
|
||||||
'--config', 'config_bittrex.json.example',
|
'--config', 'config_examples/config_bittrex.example.json',
|
||||||
"--print-list",
|
"--print-list",
|
||||||
]
|
]
|
||||||
start_list_markets(get_args(args), True)
|
start_list_markets(get_args(args), True)
|
||||||
@ -282,7 +282,7 @@ def test_list_markets(mocker, markets, capsys):
|
|||||||
# active markets, base=ETH, LTC
|
# active markets, base=ETH, LTC
|
||||||
args = [
|
args = [
|
||||||
"list-markets",
|
"list-markets",
|
||||||
'--config', 'config_bittrex.json.example',
|
'--config', 'config_examples/config_bittrex.example.json',
|
||||||
"--base", "ETH", "LTC",
|
"--base", "ETH", "LTC",
|
||||||
"--print-list",
|
"--print-list",
|
||||||
]
|
]
|
||||||
@ -295,7 +295,7 @@ def test_list_markets(mocker, markets, capsys):
|
|||||||
# active markets, base=LTC
|
# active markets, base=LTC
|
||||||
args = [
|
args = [
|
||||||
"list-markets",
|
"list-markets",
|
||||||
'--config', 'config_bittrex.json.example',
|
'--config', 'config_examples/config_bittrex.example.json',
|
||||||
"--base", "LTC",
|
"--base", "LTC",
|
||||||
"--print-list",
|
"--print-list",
|
||||||
]
|
]
|
||||||
@ -308,7 +308,7 @@ def test_list_markets(mocker, markets, capsys):
|
|||||||
# active markets, quote=USDT, USD
|
# active markets, quote=USDT, USD
|
||||||
args = [
|
args = [
|
||||||
"list-markets",
|
"list-markets",
|
||||||
'--config', 'config_bittrex.json.example',
|
'--config', 'config_examples/config_bittrex.example.json',
|
||||||
"--quote", "USDT", "USD",
|
"--quote", "USDT", "USD",
|
||||||
"--print-list",
|
"--print-list",
|
||||||
]
|
]
|
||||||
@ -321,7 +321,7 @@ def test_list_markets(mocker, markets, capsys):
|
|||||||
# active markets, quote=USDT
|
# active markets, quote=USDT
|
||||||
args = [
|
args = [
|
||||||
"list-markets",
|
"list-markets",
|
||||||
'--config', 'config_bittrex.json.example',
|
'--config', 'config_examples/config_bittrex.example.json',
|
||||||
"--quote", "USDT",
|
"--quote", "USDT",
|
||||||
"--print-list",
|
"--print-list",
|
||||||
]
|
]
|
||||||
@ -334,7 +334,7 @@ def test_list_markets(mocker, markets, capsys):
|
|||||||
# active markets, base=LTC, quote=USDT
|
# active markets, base=LTC, quote=USDT
|
||||||
args = [
|
args = [
|
||||||
"list-markets",
|
"list-markets",
|
||||||
'--config', 'config_bittrex.json.example',
|
'--config', 'config_examples/config_bittrex.example.json',
|
||||||
"--base", "LTC", "--quote", "USDT",
|
"--base", "LTC", "--quote", "USDT",
|
||||||
"--print-list",
|
"--print-list",
|
||||||
]
|
]
|
||||||
@ -347,7 +347,7 @@ def test_list_markets(mocker, markets, capsys):
|
|||||||
# active pairs, base=LTC, quote=USDT
|
# active pairs, base=LTC, quote=USDT
|
||||||
args = [
|
args = [
|
||||||
"list-pairs",
|
"list-pairs",
|
||||||
'--config', 'config_bittrex.json.example',
|
'--config', 'config_examples/config_bittrex.example.json',
|
||||||
"--base", "LTC", "--quote", "USD",
|
"--base", "LTC", "--quote", "USD",
|
||||||
"--print-list",
|
"--print-list",
|
||||||
]
|
]
|
||||||
@ -360,7 +360,7 @@ def test_list_markets(mocker, markets, capsys):
|
|||||||
# active markets, base=LTC, quote=USDT, NONEXISTENT
|
# active markets, base=LTC, quote=USDT, NONEXISTENT
|
||||||
args = [
|
args = [
|
||||||
"list-markets",
|
"list-markets",
|
||||||
'--config', 'config_bittrex.json.example',
|
'--config', 'config_examples/config_bittrex.example.json',
|
||||||
"--base", "LTC", "--quote", "USDT", "NONEXISTENT",
|
"--base", "LTC", "--quote", "USDT", "NONEXISTENT",
|
||||||
"--print-list",
|
"--print-list",
|
||||||
]
|
]
|
||||||
@ -373,7 +373,7 @@ def test_list_markets(mocker, markets, capsys):
|
|||||||
# active markets, base=LTC, quote=NONEXISTENT
|
# active markets, base=LTC, quote=NONEXISTENT
|
||||||
args = [
|
args = [
|
||||||
"list-markets",
|
"list-markets",
|
||||||
'--config', 'config_bittrex.json.example',
|
'--config', 'config_examples/config_bittrex.example.json',
|
||||||
"--base", "LTC", "--quote", "NONEXISTENT",
|
"--base", "LTC", "--quote", "NONEXISTENT",
|
||||||
"--print-list",
|
"--print-list",
|
||||||
]
|
]
|
||||||
@ -386,7 +386,7 @@ def test_list_markets(mocker, markets, capsys):
|
|||||||
# Test tabular output
|
# Test tabular output
|
||||||
args = [
|
args = [
|
||||||
"list-markets",
|
"list-markets",
|
||||||
'--config', 'config_bittrex.json.example',
|
'--config', 'config_examples/config_bittrex.example.json',
|
||||||
]
|
]
|
||||||
start_list_markets(get_args(args), False)
|
start_list_markets(get_args(args), False)
|
||||||
captured = capsys.readouterr()
|
captured = capsys.readouterr()
|
||||||
@ -396,7 +396,7 @@ def test_list_markets(mocker, markets, capsys):
|
|||||||
# Test tabular output, no markets found
|
# Test tabular output, no markets found
|
||||||
args = [
|
args = [
|
||||||
"list-markets",
|
"list-markets",
|
||||||
'--config', 'config_bittrex.json.example',
|
'--config', 'config_examples/config_bittrex.example.json',
|
||||||
"--base", "LTC", "--quote", "NONEXISTENT",
|
"--base", "LTC", "--quote", "NONEXISTENT",
|
||||||
]
|
]
|
||||||
start_list_markets(get_args(args), False)
|
start_list_markets(get_args(args), False)
|
||||||
@ -408,7 +408,7 @@ def test_list_markets(mocker, markets, capsys):
|
|||||||
# Test --print-json
|
# Test --print-json
|
||||||
args = [
|
args = [
|
||||||
"list-markets",
|
"list-markets",
|
||||||
'--config', 'config_bittrex.json.example',
|
'--config', 'config_examples/config_bittrex.example.json',
|
||||||
"--print-json"
|
"--print-json"
|
||||||
]
|
]
|
||||||
start_list_markets(get_args(args), False)
|
start_list_markets(get_args(args), False)
|
||||||
@ -420,7 +420,7 @@ def test_list_markets(mocker, markets, capsys):
|
|||||||
# Test --print-csv
|
# Test --print-csv
|
||||||
args = [
|
args = [
|
||||||
"list-markets",
|
"list-markets",
|
||||||
'--config', 'config_bittrex.json.example',
|
'--config', 'config_examples/config_bittrex.example.json',
|
||||||
"--print-csv"
|
"--print-csv"
|
||||||
]
|
]
|
||||||
start_list_markets(get_args(args), False)
|
start_list_markets(get_args(args), False)
|
||||||
@ -432,7 +432,7 @@ def test_list_markets(mocker, markets, capsys):
|
|||||||
# Test --one-column
|
# Test --one-column
|
||||||
args = [
|
args = [
|
||||||
"list-markets",
|
"list-markets",
|
||||||
'--config', 'config_bittrex.json.example',
|
'--config', 'config_examples/config_bittrex.example.json',
|
||||||
"--one-column"
|
"--one-column"
|
||||||
]
|
]
|
||||||
start_list_markets(get_args(args), False)
|
start_list_markets(get_args(args), False)
|
||||||
@ -444,7 +444,7 @@ def test_list_markets(mocker, markets, capsys):
|
|||||||
# Test --one-column
|
# Test --one-column
|
||||||
args = [
|
args = [
|
||||||
"list-markets",
|
"list-markets",
|
||||||
'--config', 'config_bittrex.json.example',
|
'--config', 'config_examples/config_bittrex.example.json',
|
||||||
"--one-column"
|
"--one-column"
|
||||||
]
|
]
|
||||||
with pytest.raises(OperationalException, match=r"Cannot get markets.*"):
|
with pytest.raises(OperationalException, match=r"Cannot get markets.*"):
|
||||||
@ -887,7 +887,7 @@ def test_start_test_pairlist(mocker, caplog, tickers, default_conf, capsys):
|
|||||||
patched_configuration_load_config_file(mocker, default_conf)
|
patched_configuration_load_config_file(mocker, default_conf)
|
||||||
args = [
|
args = [
|
||||||
'test-pairlist',
|
'test-pairlist',
|
||||||
'-c', 'config_bittrex.json.example'
|
'-c', 'config_examples/config_bittrex.example.json'
|
||||||
]
|
]
|
||||||
|
|
||||||
start_test_pairlist(get_args(args))
|
start_test_pairlist(get_args(args))
|
||||||
@ -901,7 +901,7 @@ def test_start_test_pairlist(mocker, caplog, tickers, default_conf, capsys):
|
|||||||
|
|
||||||
args = [
|
args = [
|
||||||
'test-pairlist',
|
'test-pairlist',
|
||||||
'-c', 'config_bittrex.json.example',
|
'-c', 'config_examples/config_bittrex.example.json',
|
||||||
'--one-column',
|
'--one-column',
|
||||||
]
|
]
|
||||||
start_test_pairlist(get_args(args))
|
start_test_pairlist(get_args(args))
|
||||||
@ -910,7 +910,7 @@ def test_start_test_pairlist(mocker, caplog, tickers, default_conf, capsys):
|
|||||||
|
|
||||||
args = [
|
args = [
|
||||||
'test-pairlist',
|
'test-pairlist',
|
||||||
'-c', 'config_bittrex.json.example',
|
'-c', 'config_examples/config_bittrex.example.json',
|
||||||
'--print-json',
|
'--print-json',
|
||||||
]
|
]
|
||||||
start_test_pairlist(get_args(args))
|
start_test_pairlist(get_args(args))
|
||||||
|
@ -172,7 +172,7 @@ def test_download_data_options() -> None:
|
|||||||
def test_plot_dataframe_options() -> None:
|
def test_plot_dataframe_options() -> None:
|
||||||
args = [
|
args = [
|
||||||
'plot-dataframe',
|
'plot-dataframe',
|
||||||
'-c', 'config_bittrex.json.example',
|
'-c', 'config_examples/config_bittrex.example.json',
|
||||||
'--indicators1', 'sma10', 'sma100',
|
'--indicators1', 'sma10', 'sma100',
|
||||||
'--indicators2', 'macd', 'fastd', 'fastk',
|
'--indicators2', 'macd', 'fastd', 'fastk',
|
||||||
'--plot-limit', '30',
|
'--plot-limit', '30',
|
||||||
|
@ -28,7 +28,7 @@ from tests.conftest import log_has, log_has_re, patched_configuration_load_confi
|
|||||||
|
|
||||||
@pytest.fixture(scope="function")
|
@pytest.fixture(scope="function")
|
||||||
def all_conf():
|
def all_conf():
|
||||||
config_file = Path(__file__).parents[1] / "config_full.json.example"
|
config_file = Path(__file__).parents[1] / "config_examples/config_full.example.json"
|
||||||
conf = load_config_file(str(config_file))
|
conf = load_config_file(str(config_file))
|
||||||
return conf
|
return conf
|
||||||
|
|
||||||
|
@ -67,12 +67,12 @@ def test_main_fatal_exception(mocker, default_conf, caplog) -> None:
|
|||||||
mocker.patch('freqtrade.freqtradebot.RPCManager', MagicMock())
|
mocker.patch('freqtrade.freqtradebot.RPCManager', MagicMock())
|
||||||
mocker.patch('freqtrade.freqtradebot.init_db', MagicMock())
|
mocker.patch('freqtrade.freqtradebot.init_db', MagicMock())
|
||||||
|
|
||||||
args = ['trade', '-c', 'config_bittrex.json.example']
|
args = ['trade', '-c', 'config_examples/config_bittrex.example.json']
|
||||||
|
|
||||||
# Test Main + the KeyboardInterrupt exception
|
# Test Main + the KeyboardInterrupt exception
|
||||||
with pytest.raises(SystemExit):
|
with pytest.raises(SystemExit):
|
||||||
main(args)
|
main(args)
|
||||||
assert log_has('Using config: config_bittrex.json.example ...', caplog)
|
assert log_has('Using config: config_examples/config_bittrex.example.json ...', caplog)
|
||||||
assert log_has('Fatal exception!', caplog)
|
assert log_has('Fatal exception!', caplog)
|
||||||
|
|
||||||
|
|
||||||
@ -85,12 +85,12 @@ def test_main_keyboard_interrupt(mocker, default_conf, caplog) -> None:
|
|||||||
mocker.patch('freqtrade.wallets.Wallets.update', MagicMock())
|
mocker.patch('freqtrade.wallets.Wallets.update', MagicMock())
|
||||||
mocker.patch('freqtrade.freqtradebot.init_db', MagicMock())
|
mocker.patch('freqtrade.freqtradebot.init_db', MagicMock())
|
||||||
|
|
||||||
args = ['trade', '-c', 'config_bittrex.json.example']
|
args = ['trade', '-c', 'config_examples/config_bittrex.example.json']
|
||||||
|
|
||||||
# Test Main + the KeyboardInterrupt exception
|
# Test Main + the KeyboardInterrupt exception
|
||||||
with pytest.raises(SystemExit):
|
with pytest.raises(SystemExit):
|
||||||
main(args)
|
main(args)
|
||||||
assert log_has('Using config: config_bittrex.json.example ...', caplog)
|
assert log_has('Using config: config_examples/config_bittrex.example.json ...', caplog)
|
||||||
assert log_has('SIGINT received, aborting ...', caplog)
|
assert log_has('SIGINT received, aborting ...', caplog)
|
||||||
|
|
||||||
|
|
||||||
@ -106,12 +106,12 @@ def test_main_operational_exception(mocker, default_conf, caplog) -> None:
|
|||||||
mocker.patch('freqtrade.freqtradebot.RPCManager', MagicMock())
|
mocker.patch('freqtrade.freqtradebot.RPCManager', MagicMock())
|
||||||
mocker.patch('freqtrade.freqtradebot.init_db', MagicMock())
|
mocker.patch('freqtrade.freqtradebot.init_db', MagicMock())
|
||||||
|
|
||||||
args = ['trade', '-c', 'config_bittrex.json.example']
|
args = ['trade', '-c', 'config_examples/config_bittrex.example.json']
|
||||||
|
|
||||||
# Test Main + the KeyboardInterrupt exception
|
# Test Main + the KeyboardInterrupt exception
|
||||||
with pytest.raises(SystemExit):
|
with pytest.raises(SystemExit):
|
||||||
main(args)
|
main(args)
|
||||||
assert log_has('Using config: config_bittrex.json.example ...', caplog)
|
assert log_has('Using config: config_examples/config_bittrex.example.json ...', caplog)
|
||||||
assert log_has('Oh snap!', caplog)
|
assert log_has('Oh snap!', caplog)
|
||||||
|
|
||||||
|
|
||||||
@ -157,12 +157,12 @@ def test_main_reload_config(mocker, default_conf, caplog) -> None:
|
|||||||
mocker.patch('freqtrade.freqtradebot.RPCManager', MagicMock())
|
mocker.patch('freqtrade.freqtradebot.RPCManager', MagicMock())
|
||||||
mocker.patch('freqtrade.freqtradebot.init_db', MagicMock())
|
mocker.patch('freqtrade.freqtradebot.init_db', MagicMock())
|
||||||
|
|
||||||
args = Arguments(['trade', '-c', 'config_bittrex.json.example']).get_parsed_arg()
|
args = Arguments(['trade', '-c', 'config_examples/config_bittrex.example.json']).get_parsed_arg()
|
||||||
worker = Worker(args=args, config=default_conf)
|
worker = Worker(args=args, config=default_conf)
|
||||||
with pytest.raises(SystemExit):
|
with pytest.raises(SystemExit):
|
||||||
main(['trade', '-c', 'config_bittrex.json.example'])
|
main(['trade', '-c', 'config_examples/config_bittrex.example.json'])
|
||||||
|
|
||||||
assert log_has('Using config: config_bittrex.json.example ...', caplog)
|
assert log_has('Using config: config_examples/config_bittrex.example.json ...', caplog)
|
||||||
assert worker_mock.call_count == 4
|
assert worker_mock.call_count == 4
|
||||||
assert reconfigure_mock.call_count == 1
|
assert reconfigure_mock.call_count == 1
|
||||||
assert isinstance(worker.freqtrade, FreqtradeBot)
|
assert isinstance(worker.freqtrade, FreqtradeBot)
|
||||||
@ -180,7 +180,7 @@ def test_reconfigure(mocker, default_conf) -> None:
|
|||||||
mocker.patch('freqtrade.freqtradebot.RPCManager', MagicMock())
|
mocker.patch('freqtrade.freqtradebot.RPCManager', MagicMock())
|
||||||
mocker.patch('freqtrade.freqtradebot.init_db', MagicMock())
|
mocker.patch('freqtrade.freqtradebot.init_db', MagicMock())
|
||||||
|
|
||||||
args = Arguments(['trade', '-c', 'config_bittrex.json.example']).get_parsed_arg()
|
args = Arguments(['trade', '-c', 'config_examples/config_bittrex.example.json']).get_parsed_arg()
|
||||||
worker = Worker(args=args, config=default_conf)
|
worker = Worker(args=args, config=default_conf)
|
||||||
freqtrade = worker.freqtrade
|
freqtrade = worker.freqtrade
|
||||||
|
|
||||||
|
@ -364,7 +364,7 @@ def test_start_plot_dataframe(mocker):
|
|||||||
aup = mocker.patch("freqtrade.plot.plotting.load_and_plot_trades", MagicMock())
|
aup = mocker.patch("freqtrade.plot.plotting.load_and_plot_trades", MagicMock())
|
||||||
args = [
|
args = [
|
||||||
"plot-dataframe",
|
"plot-dataframe",
|
||||||
"--config", "config_bittrex.json.example",
|
"--config", "config_examples/config_bittrex.example.json",
|
||||||
"--pairs", "ETH/BTC"
|
"--pairs", "ETH/BTC"
|
||||||
]
|
]
|
||||||
start_plot_dataframe(get_args(args))
|
start_plot_dataframe(get_args(args))
|
||||||
@ -408,7 +408,7 @@ def test_start_plot_profit(mocker):
|
|||||||
aup = mocker.patch("freqtrade.plot.plotting.plot_profit", MagicMock())
|
aup = mocker.patch("freqtrade.plot.plotting.plot_profit", MagicMock())
|
||||||
args = [
|
args = [
|
||||||
"plot-profit",
|
"plot-profit",
|
||||||
"--config", "config_bittrex.json.example",
|
"--config", "config_examples/config_bittrex.example.json",
|
||||||
"--pairs", "ETH/BTC"
|
"--pairs", "ETH/BTC"
|
||||||
]
|
]
|
||||||
start_plot_profit(get_args(args))
|
start_plot_profit(get_args(args))
|
||||||
|
Loading…
Reference in New Issue
Block a user