frameworkize nested_test.
parent
15bf0f54e2
commit
f22d05a7ad
@ -1,14 +1,19 @@
|
||||
import os
|
||||
import mitogen.utils
|
||||
import unittest
|
||||
|
||||
@mitogen.utils.run_with_router
|
||||
def main(router):
|
||||
mitogen.utils.log_to_file()
|
||||
import testlib
|
||||
|
||||
|
||||
class NestedTest(testlib.RouterMixin, testlib.TestCase):
|
||||
def test_nested(self):
|
||||
context = None
|
||||
for x in range(1, 11):
|
||||
print 'Connect local%d via %s' % (x, context)
|
||||
context = router.local(via=context, name='local%d' % x)
|
||||
#print 'Connect local%d via %s' % (x, context)
|
||||
context = self.router.local(via=context, name='local%d' % x)
|
||||
|
||||
pid = context.call(os.getpid)
|
||||
self.assertTrue(isinstance(pid, int))
|
||||
|
||||
context.call(os.system, 'pstree -s python -s mitogen')
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
Loading…
Reference in New Issue