Add missing unit test for Arguments::testdata_dl_options()

This commit is contained in:
Gerald Lonlas 2018-06-02 14:47:20 -07:00
parent 1db0f2bd55
commit 81ce7d720d
2 changed files with 26 additions and 4 deletions

View File

@ -303,28 +303,34 @@ class Arguments(object):
'--pairs-file', '--pairs-file',
help='File containing a list of pairs to download', help='File containing a list of pairs to download',
dest='pairs_file', dest='pairs_file',
default=None default=None,
metavar='PATH',
) )
self.parser.add_argument( self.parser.add_argument(
'--export', '--export',
help='Export files to given dir', help='Export files to given dir',
dest='export', dest='export',
default=None) default=None,
metavar='PATH',
)
self.parser.add_argument( self.parser.add_argument(
'--days', '--days',
help='Download data for number of days', help='Download data for number of days',
dest='days', dest='days',
type=int, type=int,
default=None) metavar='INT',
default=None
)
self.parser.add_argument( self.parser.add_argument(
'--exchange', '--exchange',
help='Exchange name (default: %(default)s)', help='Exchange name (default: %(default)s)',
dest='exchange', dest='exchange',
type=str, type=str,
default='bittrex') default='bittrex'
)
self.parser.add_argument( self.parser.add_argument(
'-t', '--timeframes', '-t', '--timeframes',

View File

@ -174,3 +174,19 @@ def test_parse_args_hyperopt_custom() -> None:
assert call_args.subparser == 'hyperopt' assert call_args.subparser == 'hyperopt'
assert call_args.spaces == ['buy'] assert call_args.spaces == ['buy']
assert call_args.func is not None 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'