fix: 按 K-00 约定修复 Python SDK 断线重交与退避
This commit is contained in:
@@ -7,8 +7,9 @@ import threading
|
||||
import time
|
||||
import unittest
|
||||
|
||||
from nixmsg import Body, Client, ConnectionState, FakeTransport, NixMsgError, SendOptions, Target
|
||||
from nixmsg import Body, Client, ConnectionState, NixMsgError, SendOptions, Target
|
||||
from nixmsg.protocol import dumps
|
||||
from nixmsg.transport import FakeTransport
|
||||
|
||||
|
||||
class FakeTransportTests(unittest.TestCase):
|
||||
@@ -48,6 +49,7 @@ class FakeTransportTests(unittest.TestCase):
|
||||
c = Client(transport=tr)
|
||||
c.on_session(lambda t: tokens.append(t))
|
||||
c.connect("ws://example.test/mqtt", "ep1", password="pw")
|
||||
time.sleep(0.05)
|
||||
self.assertEqual(tokens, ["nst_test_token"])
|
||||
self.assertEqual(c.session_token, "nst_test_token")
|
||||
c.close()
|
||||
|
||||
Reference in New Issue
Block a user