From 4f93c6823af4f657b0b47e711e66c95b74e64636 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sat, 24 Mar 2018 16:28:13 +0545 Subject: [PATCH] issue #155: skeletal fork_test. --- test.sh | 1 + tests/fork_test.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 tests/fork_test.py diff --git a/test.sh b/test.sh index 2df991eb..6e678674 100755 --- a/test.sh +++ b/test.sh @@ -40,6 +40,7 @@ run_test tests/call_function_test.py run_test tests/channel_test.py run_test tests/fakessh_test.py run_test tests/first_stage_test.py +run_test tests/fork_test.py run_test tests/id_allocation_test.py run_test tests/importer_test.py run_test tests/latch_test.py diff --git a/tests/fork_test.py b/tests/fork_test.py new file mode 100644 index 00000000..ced39e2c --- /dev/null +++ b/tests/fork_test.py @@ -0,0 +1,19 @@ + +import os + +import mitogen +import unittest2 + +import testlib +import plain_old_module + + +class ForkTest(testlib.RouterMixin, unittest2.TestCase): + def test_okay(self): + context = self.router.fork() + self.assertNotEqual(context.call(os.getpid), os.getpid()) + self.assertEqual(context.call(os.getppid), os.getpid()) + + +if __name__ == '__main__': + unittest2.main()