clan-cli: simplify cli helper
This commit is contained in:
@@ -8,8 +8,7 @@ from clan_app import main
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Cli:
|
||||
def run(self, args: list[str]) -> None:
|
||||
cmd = shlex.join(["clan", *args])
|
||||
log.debug(f"$ {cmd} \nCaller: {get_caller()}")
|
||||
main(args)
|
||||
def run(args: list[str]) -> None:
|
||||
cmd = shlex.join(["clan", *args])
|
||||
log.debug(f"$ {cmd} \nCaller: {get_caller()}")
|
||||
main(args)
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import pytest
|
||||
from helpers.cli import Cli
|
||||
from helpers import cli
|
||||
|
||||
|
||||
def test_help(capfd: pytest.CaptureFixture) -> None:
|
||||
cli = Cli()
|
||||
with pytest.raises(SystemExit):
|
||||
cli.run(["clan-app", "--help"])
|
||||
|
||||
Reference in New Issue
Block a user