mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 22:11:14 +02:00
refactor: ruff autofixes
This commit is contained in:
455 files changed
+12322
-14762
No files matched your search
@@ -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):
|
||||
#
|
||||
|
||||
@@ -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."""
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in new issue
Block a user