From af6c0205068b66bdf107b8051200e5d7df69d055 Mon Sep 17 00:00:00 2001 From: Josiah Baldwin Date: Wed, 4 Dec 2024 13:29:17 -0800 Subject: [PATCH] Kinda fixed auto reconnect --- src/meshctrl/session.py | 2 ++ tests/test_session.py | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/meshctrl/session.py b/src/meshctrl/session.py index 0233cb5..368f4c2 100644 --- a/src/meshctrl/session.py +++ b/src/meshctrl/session.py @@ -31,6 +31,7 @@ class Session(object): proxy (str): "url:port" to use for proxy server NOTE: This is currently not implemented due to a limitation of the undersying websocket library. Upvote the issue if you find this important. token (str): Login token. This appears to be superfluous ignore_ssl (bool): Ignore SSL errors + auto_reconnect (bool): In case of server failure, attempt to auto reconnect. All outstanding requests will be killed. Returns: :py:class:`Session`: Session connected to url @@ -92,6 +93,7 @@ class Session(object): self._inflight = set() self._file_tunnels = {} self._ignore_ssl = ignore_ssl + self.auto_reconnect = auto_reconnect self._eventer = util.Eventer() diff --git a/tests/test_session.py b/tests/test_session.py index 3cefa6b..5747261 100644 --- a/tests/test_session.py +++ b/tests/test_session.py @@ -396,11 +396,9 @@ async def test_session_files(env): assert r["size"] == len(randdata), "Uploaded wrong number of bytes" s = await admin_session.download(agent.nodeid, f"{pwd}/test", timeout=5) - s.seek(0) assert s.read() == randdata, "Downloaded bad data" await admin_session.download(agent.nodeid, f"{pwd}/test", downfilestream, timeout=5) - downfilestream.seek(0) assert downfilestream.read() == randdata, "Downloaded bad data" await admin_session.download_file(agent.nodeid, f"{pwd}/test2", os.path.join(thisdir, "data", "test"), timeout=5)