diff options
Diffstat (limited to 'tests/test_which.py')
| -rw-r--r-- | tests/test_which.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test_which.py b/tests/test_which.py index bda3333..f909214 100644 --- a/tests/test_which.py +++ b/tests/test_which.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import subprocess import tempfile import shutil @@ -21,9 +22,13 @@ class TestCaseWhich(PexpectTestCase.PexpectTestCase): def test_os_defpath_which(self): " which() finds an executable in $PATH and returns its abspath. " - fname = 'cc' + bin_dir = tempfile.mkdtemp() - bin_path = os.path.join(bin_dir, fname) + temp_obj = tempfile.NamedTemporaryFile( + suffix=u'.sh', prefix=u'ǝpoɔıun-', + dir=bin_dir, delete=False) + bin_path = temp_obj.name + fname = os.path.basename(temp_obj.name) save_path = os.environ['PATH'] save_defpath = os.defpath |
