Fix test failures

This commit is contained in:
Matthias 2019-10-24 06:22:05 +02:00
parent 4ce278a06e
commit e1edf36307
2 changed files with 21 additions and 19 deletions

View File

@ -179,7 +179,8 @@ class Arguments:
# Add list-markets subcommand # Add list-markets subcommand
list_markets_cmd = subparsers.add_parser( list_markets_cmd = subparsers.add_parser(
'list-markets', 'list-markets',
help='Print markets on exchange.' help='Print markets on exchange.',
parents=[_common_parser],
) )
list_markets_cmd.set_defaults(func=partial(start_list_markets, pairs_only=False)) list_markets_cmd.set_defaults(func=partial(start_list_markets, pairs_only=False))
self._build_args(optionlist=ARGS_LIST_PAIRS, parser=list_markets_cmd) self._build_args(optionlist=ARGS_LIST_PAIRS, parser=list_markets_cmd)
@ -187,7 +188,8 @@ class Arguments:
# Add list-pairs subcommand # Add list-pairs subcommand
list_pairs_cmd = subparsers.add_parser( list_pairs_cmd = subparsers.add_parser(
'list-pairs', 'list-pairs',
help='Print pairs on exchange.' help='Print pairs on exchange.',
parents=[_common_parser],
) )
list_pairs_cmd.set_defaults(func=partial(start_list_markets, pairs_only=True)) list_pairs_cmd.set_defaults(func=partial(start_list_markets, pairs_only=True))
self._build_args(optionlist=ARGS_LIST_PAIRS, parser=list_pairs_cmd) self._build_args(optionlist=ARGS_LIST_PAIRS, parser=list_pairs_cmd)

View File

@ -182,8 +182,8 @@ def test_list_markets(mocker, markets, capsys):
# Test with --config config.json.example # Test with --config config.json.example
args = [ args = [
'--config', 'config.json.example',
"list-markets", "list-markets",
'--config', 'config.json.example',
"--print-list", "--print-list",
] ]
start_list_markets(get_args(args), False) start_list_markets(get_args(args), False)
@ -208,8 +208,8 @@ def test_list_markets(mocker, markets, capsys):
patch_exchange(mocker, api_mock=api_mock, id="bittrex") patch_exchange(mocker, api_mock=api_mock, id="bittrex")
# Test with --all: all markets # Test with --all: all markets
args = [ args = [
'--config', 'config.json.example',
"list-markets", "--all", "list-markets", "--all",
'--config', 'config.json.example',
"--print-list", "--print-list",
] ]
start_list_markets(get_args(args), False) start_list_markets(get_args(args), False)
@ -221,8 +221,8 @@ def test_list_markets(mocker, markets, capsys):
# Test list-pairs subcommand: active pairs # Test list-pairs subcommand: active pairs
args = [ args = [
'--config', 'config.json.example',
"list-pairs", "list-pairs",
'--config', 'config.json.example',
"--print-list", "--print-list",
] ]
start_list_markets(get_args(args), True) start_list_markets(get_args(args), True)
@ -233,8 +233,8 @@ 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 = [
'--config', 'config.json.example',
"list-pairs", "--all", "list-pairs", "--all",
'--config', 'config.json.example',
"--print-list", "--print-list",
] ]
start_list_markets(get_args(args), True) start_list_markets(get_args(args), True)
@ -246,8 +246,8 @@ def test_list_markets(mocker, markets, capsys):
# active markets, base=ETH, LTC # active markets, base=ETH, LTC
args = [ args = [
'--config', 'config.json.example',
"list-markets", "list-markets",
'--config', 'config.json.example',
"--base", "ETH", "LTC", "--base", "ETH", "LTC",
"--print-list", "--print-list",
] ]
@ -259,8 +259,8 @@ def test_list_markets(mocker, markets, capsys):
# active markets, base=LTC # active markets, base=LTC
args = [ args = [
'--config', 'config.json.example',
"list-markets", "list-markets",
'--config', 'config.json.example',
"--base", "LTC", "--base", "LTC",
"--print-list", "--print-list",
] ]
@ -272,8 +272,8 @@ def test_list_markets(mocker, markets, capsys):
# active markets, quote=USDT, USD # active markets, quote=USDT, USD
args = [ args = [
'--config', 'config.json.example',
"list-markets", "list-markets",
'--config', 'config.json.example',
"--quote", "USDT", "USD", "--quote", "USDT", "USD",
"--print-list", "--print-list",
] ]
@ -285,8 +285,8 @@ def test_list_markets(mocker, markets, capsys):
# active markets, quote=USDT # active markets, quote=USDT
args = [ args = [
'--config', 'config.json.example',
"list-markets", "list-markets",
'--config', 'config.json.example',
"--quote", "USDT", "--quote", "USDT",
"--print-list", "--print-list",
] ]
@ -298,8 +298,8 @@ def test_list_markets(mocker, markets, capsys):
# active markets, base=LTC, quote=USDT # active markets, base=LTC, quote=USDT
args = [ args = [
'--config', 'config.json.example',
"list-markets", "list-markets",
'--config', 'config.json.example',
"--base", "LTC", "--quote", "USDT", "--base", "LTC", "--quote", "USDT",
"--print-list", "--print-list",
] ]
@ -311,8 +311,8 @@ def test_list_markets(mocker, markets, capsys):
# active pairs, base=LTC, quote=USDT # active pairs, base=LTC, quote=USDT
args = [ args = [
'--config', 'config.json.example',
"list-pairs", "list-pairs",
'--config', 'config.json.example',
"--base", "LTC", "--quote", "USDT", "--base", "LTC", "--quote", "USDT",
"--print-list", "--print-list",
] ]
@ -324,8 +324,8 @@ def test_list_markets(mocker, markets, capsys):
# active markets, base=LTC, quote=USDT, NONEXISTENT # active markets, base=LTC, quote=USDT, NONEXISTENT
args = [ args = [
'--config', 'config.json.example',
"list-markets", "list-markets",
'--config', 'config.json.example',
"--base", "LTC", "--quote", "USDT", "NONEXISTENT", "--base", "LTC", "--quote", "USDT", "NONEXISTENT",
"--print-list", "--print-list",
] ]
@ -337,8 +337,8 @@ def test_list_markets(mocker, markets, capsys):
# active markets, base=LTC, quote=NONEXISTENT # active markets, base=LTC, quote=NONEXISTENT
args = [ args = [
'--config', 'config.json.example',
"list-markets", "list-markets",
'--config', 'config.json.example',
"--base", "LTC", "--quote", "NONEXISTENT", "--base", "LTC", "--quote", "NONEXISTENT",
"--print-list", "--print-list",
] ]
@ -350,8 +350,8 @@ def test_list_markets(mocker, markets, capsys):
# Test tabular output # Test tabular output
args = [ args = [
'--config', 'config.json.example',
"list-markets", "list-markets",
'--config', 'config.json.example',
] ]
start_list_markets(get_args(args), False) start_list_markets(get_args(args), False)
captured = capsys.readouterr() captured = capsys.readouterr()
@ -360,8 +360,8 @@ def test_list_markets(mocker, markets, capsys):
# Test tabular output, no markets found # Test tabular output, no markets found
args = [ args = [
'--config', 'config.json.example',
"list-markets", "list-markets",
'--config', 'config.json.example',
"--base", "LTC", "--quote", "NONEXISTENT", "--base", "LTC", "--quote", "NONEXISTENT",
] ]
start_list_markets(get_args(args), False) start_list_markets(get_args(args), False)
@ -372,8 +372,8 @@ def test_list_markets(mocker, markets, capsys):
# Test --print-json # Test --print-json
args = [ args = [
'--config', 'config.json.example',
"list-markets", "list-markets",
'--config', 'config.json.example',
"--print-json" "--print-json"
] ]
start_list_markets(get_args(args), False) start_list_markets(get_args(args), False)
@ -383,8 +383,8 @@ def test_list_markets(mocker, markets, capsys):
# Test --print-csv # Test --print-csv
args = [ args = [
'--config', 'config.json.example',
"list-markets", "list-markets",
'--config', 'config.json.example',
"--print-csv" "--print-csv"
] ]
start_list_markets(get_args(args), False) start_list_markets(get_args(args), False)
@ -395,8 +395,8 @@ def test_list_markets(mocker, markets, capsys):
# Test --one-column # Test --one-column
args = [ args = [
'--config', 'config.json.example',
"list-markets", "list-markets",
'--config', 'config.json.example',
"--one-column" "--one-column"
] ]
start_list_markets(get_args(args), False) start_list_markets(get_args(args), False)