Improve test cov

This commit is contained in:
Matthias
2024-03-29 13:12:01 +01:00
parent 0a0105c31e
commit e971f043f4
2 changed files with 17 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ from unittest.mock import MagicMock
import pytest
from freqtrade_client import FtRestClient
from freqtrade_client.ft_client import add_arguments, main_exec
def get_rest_client():
@@ -92,3 +93,16 @@ def test_FtRestClient_call_explicit_methods(method, args):
exec = getattr(client, method)
exec(*args)
assert mock.call_count == 1
def test_ft_client(capsys):
with pytest.raises(SystemExit):
args = add_arguments(['-V'])
args = add_arguments(['--show'])
assert isinstance(args, dict)
assert args['show'] is True
with pytest.raises(SystemExit):
main_exec(args)
captured = capsys.readouterr()
assert 'Possible commands' in captured.out