]> git.phdru.name Git - ppu.git/blobdiff - tests/find_in_path.py
Split test_remove_old_files.py into find_in_path.py
[ppu.git] / tests / find_in_path.py
diff --git a/tests/find_in_path.py b/tests/find_in_path.py
new file mode 100644 (file)
index 0000000..4d00613
--- /dev/null
@@ -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