Skip to content

Commit 10627cf

Browse files
committed
Squashed commit of the following:
commit dca389e Author: theGowda <sachin08gowda@gmail.com> Date: Fri Dec 6 19:46:10 2024 +0530 remove comment commit 32b7e79 Author: theGowda <sachin08gowda@gmail.com> Date: Fri Dec 6 19:17:00 2024 +0530 mypy fix commit 923af8d Author: theGowda <sachin08gowda@gmail.com> Date: Fri Dec 6 19:11:58 2024 +0530 increased timeout commit 8c50e0a Author: theGowda <sachin08gowda@gmail.com> Date: Fri Dec 6 14:08:33 2024 +0530 fix test commit 9a3f942 Author: theGowda <sachin08gowda@gmail.com> Date: Fri Dec 6 13:43:13 2024 +0530 increase async timeout in tests
1 parent d65abf8 commit 10627cf

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

librouteros/protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def close(self) -> None:
206206

207207

208208
class AsyncApiProtocol(Encoder, Decoder):
209-
def __init__(self, transport: AsyncSocketTransport, encoding: str, timeout: float = 10):
209+
def __init__(self, transport: AsyncSocketTransport, encoding: str, timeout: typing.Optional[float] = None):
210210
self.transport = transport
211211
self.encoding = encoding
212212
self.timeout = timeout

tests/integration/async/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ async def api_session_async(port):
3030
port=port,
3131
username="admin",
3232
password="",
33+
timeout=60,
3334
)
3435
except (LibRouterosError, socket.error, socket.timeout) as exc:
3536
last_exc = exc

tests/integration/async/test_general.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ async def test_login(routeros_login_async):
1818
username="admin",
1919
password="",
2020
login_method=method,
21+
timeout=60,
2122
)
2223
break
2324
except (LibRouterosError, socket.error, socket.timeout):
2425
sleep(1)
2526

2627
# data = api("/system/identity/print")
2728
result = [r async for r in api("/system/identity/print")]
28-
assert result[0]["name"] == "Mikrotik"
29+
assert result[0]["name"] == "MikroTik"
2930

3031

3132
@pytest.mark.asyncio

0 commit comments

Comments
 (0)