Require pairs argument
This commit is contained in:
@@ -519,6 +519,13 @@ class Arguments(object):
|
||||
"""
|
||||
Parses given arguments for plot_dataframe
|
||||
"""
|
||||
self.parser.add_argument(
|
||||
'-p', '--pairs',
|
||||
help='Show profits for only this pairs. Pairs are comma-separated.',
|
||||
dest='pairs',
|
||||
required=True,
|
||||
default=None
|
||||
)
|
||||
self.parser.add_argument(
|
||||
'--indicators1',
|
||||
help='Set indicators from your strategy you want in the first row of the graph. Separate '
|
||||
|
@@ -191,13 +191,22 @@ def test_plot_dataframe_options() -> None:
|
||||
'--indicators1', 'sma10,sma100',
|
||||
'--indicators2', 'macd,fastd,fastk',
|
||||
'--plot-limit', '30',
|
||||
'-p', 'UNITTEST/BTC',
|
||||
]
|
||||
arguments = Arguments(args, '')
|
||||
arguments.plot_dataframe_options()
|
||||
args = arguments.parse_args(True)
|
||||
assert args.indicators1 == "sma10,sma100"
|
||||
assert args.indicators2 == "macd,fastd,fastk"
|
||||
assert args.plot_limit == 30
|
||||
pargs = arguments.parse_args(True)
|
||||
assert pargs.indicators1 == "sma10,sma100"
|
||||
assert pargs.indicators2 == "macd,fastd,fastk"
|
||||
assert pargs.plot_limit == 30
|
||||
assert pargs.pairs == "UNITTEST/BTC"
|
||||
|
||||
# Pop pairs argument
|
||||
args = args[:-2]
|
||||
arguments = Arguments(args, '')
|
||||
arguments.plot_dataframe_options()
|
||||
with pytest.raises(SystemExit, match=r'2'):
|
||||
arguments.parse_args(True)
|
||||
|
||||
|
||||
def test_check_int_positive() -> None:
|
||||
|
Reference in New Issue
Block a user