python-socketio 5.14.2__tar.gz → 5.14.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_socketio-5.14.2/src/python_socketio.egg-info → python_socketio-5.14.3}/PKG-INFO +1 -1
- {python_socketio-5.14.2 → python_socketio-5.14.3}/docs/server.rst +2 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/pyproject.toml +1 -1
- {python_socketio-5.14.2 → python_socketio-5.14.3/src/python_socketio.egg-info}/PKG-INFO +1 -1
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/async_aiopika_manager.py +1 -1
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/async_server.py +3 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/server.py +3 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/async/test_server.py +15 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/common/test_server.py +14 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/LICENSE +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/MANIFEST.in +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/README.md +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/docs/Makefile +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/docs/_static/README.md +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/docs/_static/custom.css +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/docs/api.rst +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/docs/client.rst +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/docs/conf.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/docs/index.rst +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/docs/intro.rst +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/docs/make.bat +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/setup.cfg +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/python_socketio.egg-info/SOURCES.txt +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/python_socketio.egg-info/dependency_links.txt +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/python_socketio.egg-info/not-zip-safe +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/python_socketio.egg-info/requires.txt +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/python_socketio.egg-info/top_level.txt +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/__init__.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/admin.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/asgi.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/async_admin.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/async_client.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/async_manager.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/async_namespace.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/async_pubsub_manager.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/async_redis_manager.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/async_simple_client.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/base_client.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/base_manager.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/base_namespace.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/base_server.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/client.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/exceptions.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/kafka_manager.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/kombu_manager.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/manager.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/middleware.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/msgpack_packet.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/namespace.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/packet.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/pubsub_manager.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/redis_manager.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/simple_client.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/tornado.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/src/socketio/zmq_manager.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/__init__.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/async/__init__.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/async/test_admin.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/async/test_client.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/async/test_manager.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/async/test_namespace.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/async/test_pubsub_manager.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/async/test_redis_manager.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/async/test_simple_client.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/asyncio_web_server.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/common/__init__.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/common/test_admin.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/common/test_client.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/common/test_manager.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/common/test_middleware.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/common/test_msgpack_packet.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/common/test_namespace.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/common/test_packet.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/common/test_pubsub_manager.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/common/test_redis_manager.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/common/test_simple_client.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/performance/README.md +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/performance/binary_packet.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/performance/json_packet.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/performance/namespace_packet.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/performance/run.sh +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/performance/server_receive.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/performance/server_send.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/performance/server_send_broadcast.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/performance/text_packet.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tests/web_server.py +0 -0
- {python_socketio-5.14.2 → python_socketio-5.14.3}/tox.ini +0 -0
|
@@ -246,6 +246,8 @@ a :class:`socketio.exceptions.ConnectionRefusedError` exception can be raised,
|
|
|
246
246
|
and all of its arguments will be sent to the client with the rejection
|
|
247
247
|
message::
|
|
248
248
|
|
|
249
|
+
from socketio.exceptions import ConnectionRefusedError
|
|
250
|
+
|
|
249
251
|
@sio.event
|
|
250
252
|
def connect(sid, environ, auth):
|
|
251
253
|
raise ConnectionRefusedError('authentication failed')
|
|
@@ -82,7 +82,7 @@ class AsyncAioPikaManager(AsyncPubSubManager): # pragma: no cover
|
|
|
82
82
|
try:
|
|
83
83
|
await self.publisher_exchange.publish(
|
|
84
84
|
aio_pika.Message(
|
|
85
|
-
body=json.dumps(data),
|
|
85
|
+
body=json.dumps(data).encode(),
|
|
86
86
|
delivery_mode=aio_pika.DeliveryMode.PERSISTENT
|
|
87
87
|
), routing_key='*',
|
|
88
88
|
)
|
|
@@ -561,6 +561,9 @@ class AsyncServer(base_server.BaseServer):
|
|
|
561
561
|
except exceptions.ConnectionRefusedError as exc:
|
|
562
562
|
fail_reason = exc.error_args
|
|
563
563
|
success = False
|
|
564
|
+
except ConnectionRefusedError:
|
|
565
|
+
fail_reason = {"message": "Connection refused by server"}
|
|
566
|
+
success = False
|
|
564
567
|
|
|
565
568
|
if success is False:
|
|
566
569
|
if self.always_connect:
|
|
@@ -543,6 +543,9 @@ class Server(base_server.BaseServer):
|
|
|
543
543
|
except exceptions.ConnectionRefusedError as exc:
|
|
544
544
|
fail_reason = exc.error_args
|
|
545
545
|
success = False
|
|
546
|
+
except ConnectionRefusedError:
|
|
547
|
+
fail_reason = {"message": "Connection refused by server"}
|
|
548
|
+
success = False
|
|
546
549
|
|
|
547
550
|
if success is False:
|
|
548
551
|
if self.always_connect:
|
|
@@ -482,6 +482,21 @@ class TestAsyncServer:
|
|
|
482
482
|
'123', '4{"message":"fail_reason"}')
|
|
483
483
|
assert s.environ == {'123': 'environ'}
|
|
484
484
|
|
|
485
|
+
async def test_handle_connect_rejected_with_python_exception(self, eio):
|
|
486
|
+
eio.return_value.send = mock.AsyncMock()
|
|
487
|
+
s = async_server.AsyncServer()
|
|
488
|
+
handler = mock.MagicMock(
|
|
489
|
+
side_effect=ConnectionRefusedError()
|
|
490
|
+
)
|
|
491
|
+
s.on('connect', handler)
|
|
492
|
+
await s._handle_eio_connect('123', 'environ')
|
|
493
|
+
await s._handle_eio_message('123', '0')
|
|
494
|
+
assert not s.manager.is_connected('1', '/')
|
|
495
|
+
handler.assert_called_once_with('1', 'environ')
|
|
496
|
+
s.eio.send.assert_awaited_once_with(
|
|
497
|
+
'123', '4{"message":"Connection refused by server"}')
|
|
498
|
+
assert s.environ == {'123': 'environ'}
|
|
499
|
+
|
|
485
500
|
async def test_handle_connect_rejected_with_empty_exception(self, eio):
|
|
486
501
|
eio.return_value.send = mock.AsyncMock()
|
|
487
502
|
s = async_server.AsyncServer()
|
|
@@ -462,6 +462,20 @@ class TestServer:
|
|
|
462
462
|
s.eio.send.assert_called_once_with('123', '4{"message":"fail_reason"}')
|
|
463
463
|
assert s.environ == {'123': 'environ'}
|
|
464
464
|
|
|
465
|
+
def test_handle_connect_rejected_with_python_exception(self, eio):
|
|
466
|
+
s = server.Server()
|
|
467
|
+
handler = mock.MagicMock(
|
|
468
|
+
side_effect=ConnectionRefusedError()
|
|
469
|
+
)
|
|
470
|
+
s.on('connect', handler)
|
|
471
|
+
s._handle_eio_connect('123', 'environ')
|
|
472
|
+
s._handle_eio_message('123', '0')
|
|
473
|
+
assert not s.manager.is_connected('1', '/')
|
|
474
|
+
handler.assert_called_once_with('1', 'environ')
|
|
475
|
+
s.eio.send.assert_called_once_with(
|
|
476
|
+
'123', '4{"message":"Connection refused by server"}')
|
|
477
|
+
assert s.environ == {'123': 'environ'}
|
|
478
|
+
|
|
465
479
|
def test_handle_connect_rejected_with_empty_exception(self, eio):
|
|
466
480
|
s = server.Server()
|
|
467
481
|
handler = mock.MagicMock(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_socketio-5.14.2 → python_socketio-5.14.3}/src/python_socketio.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_socketio-5.14.2 → python_socketio-5.14.3}/src/python_socketio.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_socketio-5.14.2 → python_socketio-5.14.3}/tests/performance/server_send_broadcast.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|