@@ -359,7 +359,7 @@ def test_handle_connect_namespace(self, eio):
359359 handler = mock .MagicMock ()
360360 s .on ('connect' , handler , namespace = '/foo' )
361361 s ._handle_eio_connect ('123' , 'environ' )
362- s ._handle_eio_message ('123' , '0/foo' )
362+ s ._handle_eio_message ('123' , '0/foo, ' )
363363 assert s .manager .is_connected ('1' , '/foo' )
364364 handler .assert_called_once_with ('1' , 'environ' )
365365 s .eio .send .assert_called_once_with ('123' , '0/foo,{"sid":"1"}' )
@@ -396,7 +396,7 @@ def test_handle_connect_namespace_rejected(self, eio):
396396 handler = mock .MagicMock (return_value = False )
397397 s .on ('connect' , handler , namespace = '/foo' )
398398 s ._handle_eio_connect ('123' , 'environ' )
399- s ._handle_eio_message ('123' , '0/foo' )
399+ s ._handle_eio_message ('123' , '0/foo, ' )
400400 assert not s .manager .is_connected ('1' , '/foo' )
401401 handler .assert_called_once_with ('1' , 'environ' )
402402 assert not s .manager .is_connected ('1' , '/foo' )
@@ -422,7 +422,7 @@ def test_handle_connect_namespace_rejected_always_connect(self, eio):
422422 handler = mock .MagicMock (return_value = False )
423423 s .on ('connect' , handler , namespace = '/foo' )
424424 s ._handle_eio_connect ('123' , 'environ' )
425- s ._handle_eio_message ('123' , '0/foo' )
425+ s ._handle_eio_message ('123' , '0/foo, ' )
426426 assert not s .manager .is_connected ('1' , '/foo' )
427427 handler .assert_called_once_with ('1' , 'environ' )
428428 s .eio .send .assert_any_call ('123' , '0/foo,{"sid":"1"}' )
@@ -464,7 +464,7 @@ def test_handle_connect_namespace_rejected_with_exception(self, eio):
464464 )
465465 s .on ('connect' , handler , namespace = '/foo' )
466466 s ._handle_eio_connect ('123' , 'environ' )
467- s ._handle_eio_message ('123' , '0/foo' )
467+ s ._handle_eio_message ('123' , '0/foo, ' )
468468 assert not s .manager .is_connected ('1' , '/foo' )
469469 s .eio .send .assert_called_once_with (
470470 '123' , '4/foo,{"message":"fail_reason","data":1}'
@@ -478,7 +478,7 @@ def test_handle_connect_namespace_rejected_with_empty_exception(self, eio):
478478 )
479479 s .on ('connect' , handler , namespace = '/foo' )
480480 s ._handle_eio_connect ('123' , 'environ' )
481- s ._handle_eio_message ('123' , '0/foo' )
481+ s ._handle_eio_message ('123' , '0/foo, ' )
482482 assert not s .manager .is_connected ('1' , '/foo' )
483483 s .eio .send .assert_called_once_with (
484484 '123' , '4/foo,{"message":"Connection rejected by server"}' )
@@ -503,7 +503,7 @@ def test_handle_disconnect_namespace(self, eio):
503503 handler_namespace = mock .MagicMock ()
504504 s .on ('disconnect' , handler_namespace , namespace = '/foo' )
505505 s ._handle_eio_connect ('123' , 'environ' )
506- s ._handle_eio_message ('123' , '0/foo' )
506+ s ._handle_eio_message ('123' , '0/foo, ' )
507507 s ._handle_eio_disconnect ('123' )
508508 handler .assert_not_called ()
509509 handler_namespace .assert_called_once_with ('1' )
@@ -516,8 +516,8 @@ def test_handle_disconnect_only_namespace(self, eio):
516516 handler_namespace = mock .MagicMock ()
517517 s .on ('disconnect' , handler_namespace , namespace = '/foo' )
518518 s ._handle_eio_connect ('123' , 'environ' )
519- s ._handle_eio_message ('123' , '0/foo' )
520- s ._handle_eio_message ('123' , '1/foo' )
519+ s ._handle_eio_message ('123' , '0/foo, ' )
520+ s ._handle_eio_message ('123' , '1/foo, ' )
521521 assert handler .call_count == 0
522522 handler_namespace .assert_called_once_with ('1' )
523523 assert s .environ == {'123' : 'environ' }
@@ -651,7 +651,7 @@ def test_send_with_ack(self, eio):
651651 def test_send_with_ack_namespace (self , eio ):
652652 s = server .Server ()
653653 s ._handle_eio_connect ('123' , 'environ' )
654- s ._handle_eio_message ('123' , '0/foo' )
654+ s ._handle_eio_message ('123' , '0/foo, ' )
655655 cb = mock .MagicMock ()
656656 id = s .manager ._generate_ack_id ('1' , cb )
657657 s ._emit_internal ('123' , 'my event' , ['foo' ], namespace = '/foo' , id = id )
@@ -711,9 +711,9 @@ def test_disconnect_ignore_queue(self, eio):
711711 def test_disconnect_namespace (self , eio ):
712712 s = server .Server ()
713713 s ._handle_eio_connect ('123' , 'environ' )
714- s ._handle_eio_message ('123' , '0/foo' )
714+ s ._handle_eio_message ('123' , '0/foo, ' )
715715 s .disconnect ('1' , namespace = '/foo' )
716- s .eio .send .assert_any_call ('123' , '1/foo' )
716+ s .eio .send .assert_any_call ('123' , '1/foo, ' )
717717
718718 def test_disconnect_twice (self , eio ):
719719 s = server .Server ()
@@ -727,7 +727,7 @@ def test_disconnect_twice(self, eio):
727727 def test_disconnect_twice_namespace (self , eio ):
728728 s = server .Server ()
729729 s ._handle_eio_connect ('123' , 'environ' )
730- s ._handle_eio_message ('123' , '0/foo' )
730+ s ._handle_eio_message ('123' , '0/foo, ' )
731731 s .disconnect ('123' , namespace = '/foo' )
732732 calls = s .eio .send .call_count
733733 s .disconnect ('123' , namespace = '/foo' )
@@ -755,7 +755,7 @@ def on_baz(self, sid, data1, data2):
755755 s = server .Server (async_handlers = False )
756756 s .register_namespace (MyNamespace ('/foo' ))
757757 s ._handle_eio_connect ('123' , 'environ' )
758- s ._handle_eio_message ('123' , '0/foo' )
758+ s ._handle_eio_message ('123' , '0/foo, ' )
759759 assert result ['result' ] == ('1' , 'environ' )
760760 s ._handle_eio_message ('123' , '2/foo,["foo","a"]' )
761761 assert result ['result' ] == ('1' , 'a' )
0 commit comments