summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Quast <contact@jeffquast.com>2015-09-21 13:03:51 -0700
committerJeff Quast <contact@jeffquast.com>2015-09-21 13:03:51 -0700
commit26764a560f22e7fce11461b8b8ab323098ee25f1 (patch)
tree9d6f10e38255554bd0e5b4a14a3210d901a40239
parent93c792eab65abdb287236efaa14f7734d4f0ba57 (diff)
downloadpexpect-26764a560f22e7fce11461b8b8ab323098ee25f1.tar.gz
Add test to ensure argv may be unicode.
-rw-r--r--tests/test_unicode.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_unicode.py b/tests/test_unicode.py
index f342bf9..4645964 100644
--- a/tests/test_unicode.py
+++ b/tests/test_unicode.py
@@ -173,6 +173,15 @@ class UnicodeTests(PexpectTestCase.PexpectTestCase):
# exercise,
assert child.readline() == 'input' + child.crlf
+ def test_unicode_argv(self):
+ """ Ensure a program can be executed with unicode arguments. """
+ p = pexpect.spawn(u'{self.PYTHONBIN} sleep_for.py ǝpoɔıun'
+ .format(self=self), timeout=5, encoding='utf8')
+ p.expect_exact(u'could not convert string to float: ǝpoɔıun')
+ p.expect(pexpect.EOF)
+ assert not p.isalive()
+ assert p.exitstatus != 0 # child process could not convert to float
+
if __name__ == '__main__':
unittest.main()