summaryrefslogtreecommitdiff
path: root/tests/topotests/lib/micronet_cli.py
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2021-09-03 08:47:30 -0400
committerChristian Hopps <chopps@labn.net>2021-09-04 09:04:47 -0400
commita53c08bc131c02f4a20931d7aa9f974194ab16e7 (patch)
tree2c48ef7c757706d47ac5b999bf667166bc1c2e1a /tests/topotests/lib/micronet_cli.py
parent4953ca977f3a5de8109ee6353ad07f816ca1774c (diff)
tests: cleanup: rerun changed files through black
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'tests/topotests/lib/micronet_cli.py')
-rw-r--r--tests/topotests/lib/micronet_cli.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/topotests/lib/micronet_cli.py b/tests/topotests/lib/micronet_cli.py
index b6cba81d86..6459d5d151 100644
--- a/tests/topotests/lib/micronet_cli.py
+++ b/tests/topotests/lib/micronet_cli.py
@@ -176,9 +176,11 @@ def cli_server(unet, server_sock):
for line in lineiter(sock):
line = line.strip()
+
def writef(x):
xb = x.encode("utf-8")
sock.send(xb)
+
if not doline(unet, line, writef):
return
sock.send(ENDMARKER)
@@ -220,7 +222,7 @@ def cli_client(sockpath, prompt="unet> "):
rb += lb
# Remove the marker
- rb = rb[:-len(ENDMARKER)]
+ rb = rb[: -len(ENDMARKER)]
# Write the output
sys.stdout.write(rb.decode("utf-8"))
@@ -239,7 +241,15 @@ def local_cli(unet, outf, prompt="unet> "):
return
-def cli(unet, histfile=None, sockpath=None, force_window=False, title=None, prompt=None, background=True):
+def cli(
+ unet,
+ histfile=None,
+ sockpath=None,
+ force_window=False,
+ title=None,
+ prompt=None,
+ background=True,
+):
if prompt is None:
prompt = "unet> "