003 File Manager
Current Path:
/usr/local/lib/python3.8/site-packages/zmq/tests
usr
/
local
/
lib
/
python3.8
/
site-packages
/
zmq
/
tests
/
📁
..
📄
__init__.py
(7.75 KB)
📁
__pycache__
📄
conftest.py
(40 B)
📄
test_asyncio.py
(15.57 KB)
📄
test_auth.py
(20.72 KB)
📄
test_cffi_backend.py
(8.79 KB)
📄
test_constants.py
(4.49 KB)
📄
test_context.py
(12.1 KB)
📄
test_cython.py
(1.03 KB)
📄
test_decorators.py
(9.4 KB)
📄
test_device.py
(6.02 KB)
📄
test_draft.py
(1.42 KB)
📄
test_error.py
(1.17 KB)
📄
test_etc.py
(545 B)
📄
test_future.py
(10.62 KB)
📄
test_imports.py
(1.76 KB)
📄
test_includes.py
(997 B)
📄
test_ioloop.py
(3.84 KB)
📄
test_log.py
(6.51 KB)
📄
test_message.py
(11.68 KB)
📄
test_monitor.py
(3 KB)
📄
test_monqueue.py
(7.97 KB)
📄
test_multipart.py
(941 B)
📄
test_mypy.py
(1.57 KB)
📄
test_pair.py
(1.24 KB)
📄
test_poll.py
(7.17 KB)
📄
test_proxy_steerable.py
(3.7 KB)
📄
test_pubsub.py
(1.07 KB)
📄
test_reqrep.py
(1.8 KB)
📄
test_retry_eintr.py
(2.88 KB)
📄
test_security.py
(8 KB)
📄
test_socket.py
(23.09 KB)
📄
test_ssh.py
(235 B)
📄
test_version.py
(1.3 KB)
📄
test_win32_shim.py
(1.68 KB)
📄
test_z85.py
(2.15 KB)
📄
test_zmqstream.py
(2.35 KB)
Editing: test_z85.py
# -*- coding: utf8 -*- """Test Z85 encoding confirm values and roundtrip with test values from the reference implementation. """ # Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. from unittest import TestCase from zmq.utils import z85 class TestZ85(TestCase): def test_client_public(self): client_public = ( b"\xBB\x88\x47\x1D\x65\xE2\x65\x9B" b"\x30\xC5\x5A\x53\x21\xCE\xBB\x5A" b"\xAB\x2B\x70\xA3\x98\x64\x5C\x26" b"\xDC\xA2\xB2\xFC\xB4\x3F\xC5\x18" ) encoded = z85.encode(client_public) self.assertEqual(encoded, b"Yne@$w-vo<fVvi]a<NY6T1ed:M$fCG*[IaLV{hID") decoded = z85.decode(encoded) self.assertEqual(decoded, client_public) def test_client_secret(self): client_secret = ( b"\x7B\xB8\x64\xB4\x89\xAF\xA3\x67" b"\x1F\xBE\x69\x10\x1F\x94\xB3\x89" b"\x72\xF2\x48\x16\xDF\xB0\x1B\x51" b"\x65\x6B\x3F\xEC\x8D\xFD\x08\x88" ) encoded = z85.encode(client_secret) self.assertEqual(encoded, b"D:)Q[IlAW!ahhC2ac:9*A}h:p?([4%wOTJ%JR%cs") decoded = z85.decode(encoded) self.assertEqual(decoded, client_secret) def test_server_public(self): server_public = ( b"\x54\xFC\xBA\x24\xE9\x32\x49\x96" b"\x93\x16\xFB\x61\x7C\x87\x2B\xB0" b"\xC1\xD1\xFF\x14\x80\x04\x27\xC5" b"\x94\xCB\xFA\xCF\x1B\xC2\xD6\x52" ) encoded = z85.encode(server_public) self.assertEqual(encoded, b"rq:rM>}U?@Lns47E1%kR.o@n%FcmmsL/@{H8]yf7") decoded = z85.decode(encoded) self.assertEqual(decoded, server_public) def test_server_secret(self): server_secret = ( b"\x8E\x0B\xDD\x69\x76\x28\xB9\x1D" b"\x8F\x24\x55\x87\xEE\x95\xC5\xB0" b"\x4D\x48\x96\x3F\x79\x25\x98\x77" b"\xB4\x9C\xD9\x06\x3A\xEA\xD3\xB7" ) encoded = z85.encode(server_secret) self.assertEqual(encoded, b"JTKVSB%%)wK0E.X)V>+}o?pNmC{O&4W4b!Ni{Lh6") decoded = z85.decode(encoded) self.assertEqual(decoded, server_secret)
Upload File
Create Folder