diff options
author | Jinkun Jang <jinkun.jang@samsung.com> | 2013-03-13 02:21:24 +0900 |
---|---|---|
committer | Jinkun Jang <jinkun.jang@samsung.com> | 2013-03-13 02:21:24 +0900 |
commit | c6b9e84f2f7f8c85939a8e5ff5d8a5aa067cecf3 (patch) | |
tree | 1436172370a45714687122f914354ad167a2f528 /tests/test_subprocess.py | |
parent | f7d643cbb2184346b6f8d26091eb7eb38c6bbfe1 (diff) | |
download | pygobject2-c6b9e84f2f7f8c85939a8e5ff5d8a5aa067cecf3.tar.gz pygobject2-c6b9e84f2f7f8c85939a8e5ff5d8a5aa067cecf3.tar.bz2 pygobject2-c6b9e84f2f7f8c85939a8e5ff5d8a5aa067cecf3.zip |
Tizen 2.1 basesubmit/tizen_2.1/20130425.060530submit/tizen_2.1/20130424.235900submit/tizen/20130517.051955accepted/tizen_2.1/20130425.021253accepted/tizen/20130520.1018302.1b_releasetizen_2.1
Diffstat (limited to 'tests/test_subprocess.py')
-rw-r--r-- | tests/test_subprocess.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_subprocess.py b/tests/test_subprocess.py new file mode 100644 index 0000000..1522edb --- /dev/null +++ b/tests/test_subprocess.py @@ -0,0 +1,27 @@ +# -*- Mode: Python -*- + +import sys +import unittest + +from common import glib + + +class TestProcess(unittest.TestCase): + + def _child_watch_cb(self, pid, condition, data): + self.data = data + self.loop.quit() + + def testChildWatch(self): + self.data = None + self.loop = glib.MainLoop() + argv = [sys.executable, '-c', 'import sys'] + pid, stdin, stdout, stderr = glib.spawn_async( + argv, flags=glib.SPAWN_DO_NOT_REAP_CHILD) + pid.close() + glib.child_watch_add(pid, self._child_watch_cb, 12345) + self.loop.run() + self.assertEqual(self.data, 12345) + +if __name__ == '__main__': + unittest.main() |