2017-11-12 12:42:27 +00:00
|
|
|
import unittest2
|
2017-09-18 09:04:05 +00:00
|
|
|
|
|
|
|
import mitogen.core
|
|
|
|
import testlib
|
|
|
|
|
|
|
|
|
2017-10-01 10:00:43 +00:00
|
|
|
class ConstructorTest(testlib.RouterMixin, testlib.TestCase):
|
2017-09-18 09:04:05 +00:00
|
|
|
def test_constructor(self):
|
|
|
|
# issue 32
|
|
|
|
l1 = self.router.local()
|
|
|
|
chan = mitogen.core.Channel(self.router, l1, 123)
|
2017-11-11 23:08:08 +00:00
|
|
|
self.assertEqual(chan.router, self.router)
|
|
|
|
self.assertEqual(chan.context, l1)
|
|
|
|
self.assertEqual(chan.dst_handle, 123)
|
|
|
|
self.assertIsNotNone(chan.handle)
|
|
|
|
self.assertGreater(chan.handle, 0)
|
2017-10-01 10:00:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2017-11-12 12:42:27 +00:00
|
|
|
unittest2.main()
|