mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
feat: add test for test_list_data command
This commit is contained in:
@@ -1692,6 +1692,53 @@ def test_start_list_data(testdatadir, capsys):
|
||||
)
|
||||
|
||||
|
||||
def test_start_list_trades_data(testdatadir, capsys):
|
||||
args = [
|
||||
"list-data",
|
||||
"--datadir",
|
||||
str(testdatadir),
|
||||
"--trades",
|
||||
]
|
||||
pargs = get_args(args)
|
||||
pargs["config"] = None
|
||||
start_list_data(pargs)
|
||||
captured = capsys.readouterr()
|
||||
assert "Found trades data for 1 pair." in captured.out
|
||||
assert re.search(r".*Pair.*Type.*\n", captured.out)
|
||||
assert re.search(r"\n.* XRP/ETH .* spot |\n", captured.out)
|
||||
|
||||
args = [
|
||||
"list-data",
|
||||
"--datadir",
|
||||
str(testdatadir),
|
||||
"--trades",
|
||||
"--show-timerange",
|
||||
]
|
||||
pargs = get_args(args)
|
||||
pargs["config"] = None
|
||||
start_list_data(pargs)
|
||||
captured = capsys.readouterr()
|
||||
assert "Found trades data for 1 pair." in captured.out
|
||||
assert re.search(r".*Pair.*Type.*From.*To.*Trades.*\n", captured.out)
|
||||
assert re.search(
|
||||
r"\n.* XRP/ETH .* spot .* 2019-10-11 00:00:01 .* 2019-10-13 11:19:28 .* 12477 .*|\n",
|
||||
captured.out,
|
||||
)
|
||||
|
||||
args = [
|
||||
"list-data",
|
||||
"--datadir",
|
||||
str(testdatadir),
|
||||
"--trades",
|
||||
"--show-timerange",
|
||||
]
|
||||
pargs = get_args(args)
|
||||
pargs["config"] = None
|
||||
start_list_data(pargs)
|
||||
captured = capsys.readouterr()
|
||||
assert "Found trades data for 0 pair." in captured.out
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("init_persistence")
|
||||
def test_show_trades(mocker, fee, capsys, caplog):
|
||||
mocker.patch("freqtrade.persistence.init_db")
|
||||
|
||||
Reference in New Issue
Block a user