From 5da930411e15459e619db2c9baaa41d80c4d967f Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Thu, 26 Jan 2023 15:11:47 -0500 Subject: [PATCH] cephadm/tests: add test coverage for find_program Signed-off-by: John Mulligan --- src/cephadm/tests/test_util_funcs.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cephadm/tests/test_util_funcs.py b/src/cephadm/tests/test_util_funcs.py index 7a922bcdd48..df444deb99e 100644 --- a/src/cephadm/tests/test_util_funcs.py +++ b/src/cephadm/tests/test_util_funcs.py @@ -328,3 +328,11 @@ class TestFindExecutable: def test_no_such_exe(self): exe = _cephadm.find_executable("foo_bar-baz.noway") assert exe is None + + +def test_find_program(): + exe = _cephadm.find_program("true") + assert exe.endswith("true") + + with pytest.raises(ValueError): + _cephadm.find_program("foo_bar-baz.noway") -- 2.39.5