From 553369896b9dc2d8ab80f87ea3526320abf11c7d Mon Sep 17 00:00:00 2001 From: Alex Myers Date: Tue, 15 Aug 2023 10:42:23 -0500 Subject: [PATCH] pytest: add no argument cli test --- tests/test_misc.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_misc.py b/tests/test_misc.py index ef410852a..ee59d5b7f 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -1195,6 +1195,13 @@ def test_daemon_option(node_factory): assert 'No child process' not in f.read() +def test_cli_no_argument(): + """If no arguments are provided, should display help and exit.""" + out = subprocess.run(['cli/lightning-cli'], stdout=subprocess.PIPE) + assert out.returncode in [0, 2] # returns 2 if lightning-rpc not available + assert "Usage: cli/lightning-cli [...]" in out.stdout.decode() + + @pytest.mark.developer("needs DEVELOPER=1") def test_blockchaintrack(node_factory, bitcoind): """Check that we track the blockchain correctly across reorgs