issue #477: util/fakessh/two_three_compat fixes.

issue510
David Wilson 5 years ago
parent 61297c24e5
commit 25bffc424d

@ -0,0 +1,6 @@
def ping(*args):
return args

@ -2,7 +2,6 @@
import os
import shutil
import timeoutcontext
import unittest2
import mitogen.fakessh
@ -11,7 +10,6 @@ import testlib
class RsyncTest(testlib.DockerMixin, testlib.TestCase):
@timeoutcontext.timeout(5)
@unittest2.skip('broken')
def test_rsync_from_master(self):
context = self.docker_ssh_any()
@ -28,7 +26,6 @@ class RsyncTest(testlib.DockerMixin, testlib.TestCase):
self.assertTrue(context.call(os.path.exists, '/tmp/data'))
self.assertTrue(context.call(os.path.exists, '/tmp/data/simple_pkg/a.py'))
@timeoutcontext.timeout(5)
@unittest2.skip('broken')
def test_rsync_between_direct_children(self):
# master -> SSH -> mitogen__has_sudo_pubkey -> rsync(.ssh) -> master ->

@ -8,11 +8,11 @@ import mitogen.core
import mitogen.master
import testlib
import simple_pkg.ping
def roundtrip(*args):
return args
# 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.
class TwoThreeCompatTest(testlib.RouterMixin, testlib.TestCase):
if mitogen.core.PY3:
@ -21,10 +21,10 @@ class TwoThreeCompatTest(testlib.RouterMixin, testlib.TestCase):
python_path = 'python3'
def test_succeeds(self):
spare = self.router.fork()
spare = self.router.local()
target = self.router.local(python_path=self.python_path)
spare2, = target.call(roundtrip, spare)
spare2, = target.call(simple_pkg.ping.ping, spare)
self.assertEquals(spare.context_id, spare2.context_id)
self.assertEquals(spare.name, spare2.name)

@ -5,6 +5,7 @@ import unittest2
import mitogen.core
import mitogen.master
import mitogen.utils
from mitogen.core import b
import testlib
@ -86,7 +87,7 @@ class CastTest(testlib.TestCase):
self.assertEqual(type(mitogen.utils.cast(Unicode())), mitogen.core.UnicodeType)
def test_bytes(self):
self.assertEqual(type(mitogen.utils.cast(b'')), mitogen.core.BytesType)
self.assertEqual(type(mitogen.utils.cast(b(''))), mitogen.core.BytesType)
self.assertEqual(type(mitogen.utils.cast(Bytes())), mitogen.core.BytesType)
def test_unknown(self):

Loading…
Cancel
Save