diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-13 13:13:33 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-13 13:13:33 (GMT) |
commit | a25c542c476b84b30a7172d5b4f7e2c82330f6f4 (patch) | |
tree | 80b796002bfe0ab0c513aa647abf3d5a06bd00ba | |
parent | bdd574d09a834f4b9935d91fe9d16a0d4a56d846 (diff) | |
download | cpython-a25c542c476b84b30a7172d5b4f7e2c82330f6f4.zip cpython-a25c542c476b84b30a7172d5b4f7e2c82330f6f4.tar.gz cpython-a25c542c476b84b30a7172d5b4f7e2c82330f6f4.tar.bz2 |
Issue #21849: Ported from 2.7 tests for non-ASCII data.
-rw-r--r-- | Lib/test/_test_multiprocessing.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 2d4395e..9466d4e 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -2020,6 +2020,12 @@ SERIALIZER = 'xmlrpclib' class _TestRemoteManager(BaseTestCase): ALLOWED_TYPES = ('manager',) + values = ['hello world', None, True, 2.25, + 'hall\xe5 v\xe4rlden', + '\u043f\u0440\u0438\u0432\u0456\u0442 \u0441\u0432\u0456\u0442', + b'hall\xe5 v\xe4rlden', + ] + result = values[:] @classmethod def _putter(cls, address, authkey): @@ -2028,7 +2034,8 @@ class _TestRemoteManager(BaseTestCase): ) manager.connect() queue = manager.get_queue() - queue.put(('hello world', None, True, 2.25)) + # Note that xmlrpclib will deserialize object as a list not a tuple + queue.put(tuple(cls.values)) def test_remote(self): authkey = os.urandom(32) @@ -2048,8 +2055,7 @@ class _TestRemoteManager(BaseTestCase): manager2.connect() queue = manager2.get_queue() - # Note that xmlrpclib will deserialize object as a list not a tuple - self.assertEqual(queue.get(), ['hello world', None, True, 2.25]) + self.assertEqual(queue.get(), self.result) # Because we are using xmlrpclib for serialization instead of # pickle this will cause a serialization error. @@ -3405,12 +3411,12 @@ class TestNoForkBomb(unittest.TestCase): name = os.path.join(os.path.dirname(__file__), 'mp_fork_bomb.py') if sm != 'fork': rc, out, err = test.script_helper.assert_python_failure(name, sm) - self.assertEqual('', out.decode('ascii')) - self.assertIn('RuntimeError', err.decode('ascii')) + self.assertEqual(out, b'') + self.assertIn(b'RuntimeError', err) else: rc, out, err = test.script_helper.assert_python_ok(name, sm) - self.assertEqual('123', out.decode('ascii').rstrip()) - self.assertEqual('', err.decode('ascii')) + self.assertEqual(out.rstrip(), b'123') + self.assertEqual(err, b'') # # Issue #17555: ForkAwareThreadLock |