]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm/tests: add test coverage for find_program
authorJohn Mulligan <jmulligan@redhat.com>
Thu, 26 Jan 2023 20:11:47 +0000 (15:11 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 26 Jan 2023 20:11:47 +0000 (15:11 -0500)
Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/tests/test_util_funcs.py

index 7a922bcdd48c0588e14f5e4b4a384b7c88205974..df444deb99e496342ee88b146a8ca9596b21ed1c 100644 (file)
@@ -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")