diff --git a/tests/asyncio/test_asyncio_server.py b/tests/asyncio/test_asyncio_server.py index 8d0b2e0..29c702c 100644 --- a/tests/asyncio/test_asyncio_server.py +++ b/tests/asyncio/test_asyncio_server.py @@ -229,6 +229,13 @@ class TestAsyncServer(unittest.TestCase): s.eio.send.mock.assert_called_once_with( '123', '2/foo,["my event",["foo","bar"]]', binary=False) + def test_emit_internal_with_none(self, eio): + eio.return_value.send = AsyncMock() + s = asyncio_server.AsyncServer() + _run(s._emit_internal('123', 'my event', None, namespace='/foo')) + s.eio.send.mock.assert_called_once_with( + '123', '2/foo,["my event"]', binary=False) + def test_emit_internal_with_callback(self, eio): eio.return_value.send = AsyncMock() s = asyncio_server.AsyncServer() diff --git a/tests/common/test_server.py b/tests/common/test_server.py index abecaf0..38fbb08 100644 --- a/tests/common/test_server.py +++ b/tests/common/test_server.py @@ -219,6 +219,12 @@ class TestServer(unittest.TestCase): '2/foo,["my event",["foo","bar"]]', binary=False) + def test_emit_internal_with_none(self, eio): + s = server.Server() + s._emit_internal('123', 'my event', None, namespace='/foo') + s.eio.send.assert_called_once_with('123', '2/foo,["my event"]', + binary=False) + def test_emit_internal_with_callback(self, eio): s = server.Server() id = s.manager._generate_ack_id('123', '/foo', 'cb')