From df1395de04e8ee7d26aa73d1d61055041c8d9b55 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Fri, 11 Oct 2024 14:15:18 +0200 Subject: [PATCH] Add test for pifpaf list command This adds a test that the pifpaf list command exites successfully and contains atleast one driver name. --- pifpaf/tests/test_cli.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pifpaf/tests/test_cli.py b/pifpaf/tests/test_cli.py index ccde70b..e04b065 100644 --- a/pifpaf/tests/test_cli.py +++ b/pifpaf/tests/test_cli.py @@ -147,6 +147,14 @@ def test_global_urls_variable_old_format(self): b"\"memcached://localhost:11217;memcached://localhost:11218\";", env[b"export PIFPAF_URLS"]) + def test_list_command(self): + c = subprocess.Popen(["pifpaf", "list"], + bufsize=0, + stdout=subprocess.PIPE) + (stdout, stderr) = c.communicate() + self.assertEqual(0, c.wait()) + self.assertIn("memcached", stdout) + def test_non_existing_command(self): # Keep PATH to just the one set by tox to run pifpaf self.useFixture(fixtures.EnvironmentVariable(