Skip to content

Commit

Permalink
Add missing unit test for Arguments::testdata_dl_options()
Browse files Browse the repository at this point in the history
  • Loading branch information
glonlas committed Jun 8, 2018
1 parent 1db0f2b commit 81ce7d7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
14 changes: 10 additions & 4 deletions freqtrade/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,28 +303,34 @@ def testdata_dl_options(self) -> None:
'--pairs-file',
help='File containing a list of pairs to download',
dest='pairs_file',
default=None
default=None,
metavar='PATH',
)

self.parser.add_argument(
'--export',
help='Export files to given dir',
dest='export',
default=None)
default=None,
metavar='PATH',
)

self.parser.add_argument(
'--days',
help='Download data for number of days',
dest='days',
type=int,
default=None)
metavar='INT',
default=None
)

self.parser.add_argument(
'--exchange',
help='Exchange name (default: %(default)s)',
dest='exchange',
type=str,
default='bittrex')
default='bittrex'
)

self.parser.add_argument(
'-t', '--timeframes',
Expand Down
16 changes: 16 additions & 0 deletions freqtrade/tests/test_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,19 @@ def test_parse_args_hyperopt_custom() -> None:
assert call_args.subparser == 'hyperopt'
assert call_args.spaces == ['buy']
assert call_args.func is not None


def test_testdata_dl_options() -> None:
args = [
'--pairs-file', 'file_with_pairs',
'--export', 'export/folder',
'--days', '30',
'--exchange', 'binance'
]
arguments = Arguments(args, '')
arguments.testdata_dl_options()
args = arguments.parse_args()
assert args.pairs_file == 'file_with_pairs'
assert args.export == 'export/folder'
assert args.days == 30
assert args.exchange == 'binance'

0 comments on commit 81ce7d7

Please sign in to comment.