diff options
author | Jeff Quast <contact@jeffquast.com> | 2015-09-21 12:58:29 -0700 |
---|---|---|
committer | Jeff Quast <contact@jeffquast.com> | 2015-09-21 12:58:29 -0700 |
commit | 93c792eab65abdb287236efaa14f7734d4f0ba57 (patch) | |
tree | 30cfb8fa4c6cdd023023d6fb0c516f61cc5e1baf /tests/test_which.py | |
parent | 944675a22ccedfda2ad8bad4ca4b852d5952883e (diff) | |
download | pexpect-git-93c792eab65abdb287236efaa14f7734d4f0ba57.tar.gz |
Use a unicode name to assert which()
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 |