2018-04-17 16:40:45 +00:00
|
|
|
|
|
|
|
import logging
|
|
|
|
import time
|
|
|
|
|
|
|
|
import unittest2
|
|
|
|
|
|
|
|
import mitogen.core
|
|
|
|
import mitogen.master
|
|
|
|
|
|
|
|
import testlib
|
2019-01-23 12:44:08 +00:00
|
|
|
import simple_pkg.ping
|
2018-04-17 16:40:45 +00:00
|
|
|
|
|
|
|
|
2019-01-23 12:44:08 +00:00
|
|
|
# TODO: this is a joke. 2/3 interop is one of the hardest bits to get right.
|
|
|
|
# There should be 100 tests in this file.
|
2019-01-20 07:08:11 +00:00
|
|
|
|
2018-04-17 16:40:45 +00:00
|
|
|
class TwoThreeCompatTest(testlib.RouterMixin, testlib.TestCase):
|
|
|
|
if mitogen.core.PY3:
|
|
|
|
python_path = 'python2'
|
|
|
|
else:
|
|
|
|
python_path = 'python3'
|
|
|
|
|
|
|
|
def test_succeeds(self):
|
2019-01-23 12:44:08 +00:00
|
|
|
spare = self.router.local()
|
2018-04-17 16:40:45 +00:00
|
|
|
target = self.router.local(python_path=self.python_path)
|
|
|
|
|
2019-01-23 12:44:08 +00:00
|
|
|
spare2, = target.call(simple_pkg.ping.ping, spare)
|
2018-04-17 16:40:45 +00:00
|
|
|
self.assertEquals(spare.context_id, spare2.context_id)
|
|
|
|
self.assertEquals(spare.name, spare2.name)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest2.main()
|