Move check_int_positive out of arguments class

This commit is contained in:
Matthias
2019-06-22 20:09:39 +02:00
parent 31a2aac627
commit 7166674d6c
2 changed files with 24 additions and 23 deletions

View File

@@ -3,7 +3,7 @@ import argparse
import pytest
from freqtrade.arguments import Arguments, TimeRange
from freqtrade.arguments import Arguments, TimeRange, check_int_positive
# Parse common command-line-arguments. Used for all tools
@@ -206,18 +206,18 @@ def test_plot_dataframe_options() -> None:
def test_check_int_positive() -> None:
assert Arguments.check_int_positive("3") == 3
assert Arguments.check_int_positive("1") == 1
assert Arguments.check_int_positive("100") == 100
assert check_int_positive("3") == 3
assert check_int_positive("1") == 1
assert check_int_positive("100") == 100
with pytest.raises(argparse.ArgumentTypeError):
Arguments.check_int_positive("-2")
check_int_positive("-2")
with pytest.raises(argparse.ArgumentTypeError):
Arguments.check_int_positive("0")
check_int_positive("0")
with pytest.raises(argparse.ArgumentTypeError):
Arguments.check_int_positive("3.5")
check_int_positive("3.5")
with pytest.raises(argparse.ArgumentTypeError):
Arguments.check_int_positive("DeadBeef")
check_int_positive("DeadBeef")