X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=tests%2Ffind_in_path.py;fp=tests%2Ffind_in_path.py;h=4d006133d7d8fa8f6232a8fbe27b794747d5419f;hb=f49c1ad164e7eb7eda2c52344282401589d0f66f;hp=0000000000000000000000000000000000000000;hpb=c3c81973f94f6b4617a2271bbaeef01ecad502bb;p=ppu.git diff --git a/tests/find_in_path.py b/tests/find_in_path.py new file mode 100644 index 0000000..4d00613 --- /dev/null +++ b/tests/find_in_path.py @@ -0,0 +1,9 @@ +import os + + +def find_in_path(name): + for path in os.environ["PATH"].split(os.pathsep): + path = path.strip('"') + test_prog_path = os.path.join(path, name) + if os.path.exists(test_prog_path): + return test_prog_path