osbuild: testutil provides has_executable

Add a helper function to determine if an executable is on PATH.
This commit is contained in:
Simon de Vlieger 2023-11-10 07:40:56 +01:00
parent be85b2342c
commit 1f51938046

View file

@ -1,3 +1,8 @@
"""
Test related utilities
"""
import shutil
def has_executable(executable: str) -> bool:
return shutil.which(executable) is not None