refactor: ruff autofixes

This commit is contained in:
Mark Paronyan committed 2026-09-27 15:55:10 +03:00
1 parent 2ac637c662
commit a0450b6bce
455 files changed
+12322 -14762

No files matched your search

+2 -2
View File
@@ -17,9 +17,9 @@
import asyncio
#from gns3server.utils.asyncio.embed_shell import EmbedShell
# from gns3server.utils.asyncio.embed_shell import EmbedShell
#FIXME: this is broken with recent Python >= 3.6
# FIXME: this is broken with recent Python >= 3.6
# def test_embed_shell_help(async_run):
# class Application(EmbedShell):
#
+3 -3
View File
@@ -11,6 +11,7 @@ from gns3server.utils.asyncio.ssh_server import AsyncioSSHServer
# Helpers
# ---------------------------------------------------------------------------
class DummyUpstreamWriter:
def __init__(self):
self.buffer = bytearray()
@@ -49,15 +50,14 @@ async def _wait_for_session_count(server, expected_count, timeout=2):
if last_count == expected_count:
return
await asyncio.sleep(0.05)
assert last_count == expected_count, (
f"Expected {expected_count} sessions, got {last_count} after {timeout}s"
)
assert last_count == expected_count, f"Expected {expected_count} sessions, got {last_count} after {timeout}s"
# ---------------------------------------------------------------------------
# Tests
# ---------------------------------------------------------------------------
@pytest.mark.asyncio
async def test_ssh_server_forwards_client_input_to_upstream_writer():
"""Data typed by a connected SSH client must reach the upstream writer."""
+1 -3
View File
@@ -113,9 +113,7 @@ async def test_telnet_server_naws_callback_uses_negotiated_dimensions():
client_writer = None
try:
_, client_writer = await telnetlib3.open_connection(
"127.0.0.1", port, encoding=False, cols=132, rows=44
)
_, client_writer = await telnetlib3.open_connection("127.0.0.1", port, encoding=False, cols=132, rows=44)
await asyncio.wait_for(callback_event.wait(), timeout=2)
assert callback_result == {"columns": 132, "rows": 44}