Mercurial > treepkg
comparison test/test_run.py @ 164:a68a4e22549c
Extend treepkg.run.call so that data can be fed to stdin of the subprocess.
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Fri, 20 Jun 2008 14:06:27 +0000 |
parents | e08b4b09d35f |
children | c7ac67366492 |
comparison
equal
deleted
inserted
replaced
163:674d14305e97 | 164:a68a4e22549c |
---|---|
46 except SubprocessError, exc: | 46 except SubprocessError, exc: |
47 self.fail("the extra_env variables were not set properly") | 47 self.fail("the extra_env variables were not set properly") |
48 else: | 48 else: |
49 # test OK | 49 # test OK |
50 pass | 50 pass |
51 | |
52 def test_call_inputdata(self): | |
53 """Test call with inputdata passed to the subprocesses stdin""" | |
54 # FIXME: If the feature being tested is not implemented | |
55 # properly, it's likely that the subprocess will wait | |
56 # indefinitely waiting for input. | |
57 data = "1" | |
58 subprocess_cmd = [sys.executable, "-c", | |
59 "import sys; sys.exit(int(raw_input("")))"] | |
60 try: | |
61 call(subprocess_cmd, inputdata=data) | |
62 except SubprocessError, exc: | |
63 self.assertEquals(exc.returncode, 1) |