From 9fe3ba366545ba9e308b0757876279b1fff8a553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mochol=C3=AD?= Date: Thu, 3 Nov 2022 15:04:47 +0100 Subject: [PATCH] Debug Windows --- tests/tests_app/cli/test_cli.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tests/tests_app/cli/test_cli.py b/tests/tests_app/cli/test_cli.py index de3d224652..4f9b5f1448 100644 --- a/tests/tests_app/cli/test_cli.py +++ b/tests/tests_app/cli/test_cli.py @@ -1,4 +1,4 @@ -import os +import subprocess from unittest import mock from unittest.mock import MagicMock @@ -52,7 +52,12 @@ def test_commands(command): def test_main_lightning_cli_no_arguments(): """Validate the Lightning CLI without args.""" - res = os.popen("lightning").read() + # FIXME: + import sys + + if sys.platform == "win32": + print(subprocess.getoutput("where lightning")) + res = subprocess.getoutput("lightning") assert "login " in res assert "logout " in res assert "run " in res @@ -66,7 +71,7 @@ def test_main_lightning_cli_no_arguments(): def test_main_lightning_cli_help(): """Validate the Lightning CLI.""" - res = os.popen("lightning --help").read() + res = subprocess.getoutput("lightning --help") assert "login " in res assert "logout " in res assert "run " in res @@ -77,7 +82,7 @@ def test_main_lightning_cli_help(): assert "add " in res assert "remove " in res - res = os.popen("lightning run --help").read() + res = subprocess.getoutput("lightning run --help") assert "app " in res # hidden run commands should not appear in the help text @@ -87,12 +92,12 @@ def test_main_lightning_cli_help(): assert "frontend" not in res # inspect show group - res = os.popen("lightning show --help").read() + res = subprocess.getoutput("lightning show --help") assert "logs " in res assert "cluster " in res # inspect show cluster group - res = os.popen("lightning show cluster --help").read() + res = subprocess.getoutput("lightning show cluster --help") assert "logs " in res @@ -185,7 +190,7 @@ def test_cli_logout(exists: mock.MagicMock, unlink: mock.MagicMock, creds: bool) def test_lightning_cli_version(): - res = os.popen("lightning --version").read() + res = subprocess.getoutput("lightning --version") assert __version__ in res