Skip to content

Commit

Permalink
fix black format error
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhsuan committed Jan 15, 2025
1 parent 584dc32 commit d3842b7
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ def __init__(
try:
self.group.append(self.serial_init(ser))
except Exception:
raise SystemError(
"Failed to init serial port: {}".format(ser)
)
raise SystemError("Failed to init serial port: {}".format(ser))

def serial_init(self, node: str) -> serial.Serial:
"""Create a serial.Serial object based on the class variables"""
Expand Down Expand Up @@ -165,7 +163,7 @@ def client_mode(ser: Serial, data_size: int = 1024):
random_string = generate_random_string(data_size)

# clean up the garbage in the serial before test
while ser.recv() :
while ser.recv():
continue
ser.send(random_string.encode())
for i in range(1, 6):
Expand Down Expand Up @@ -201,9 +199,7 @@ def console_mode(ser: Serial):
logging.info("[PASS] Serial console test successful.")
else:
logging.error("[FAIL] Serial console test failed.")
logging.error(
"Expected response should contain ':~$' or 'login:'"
)
logging.error("Expected response should contain ':~$' or 'login:'")
raise SystemExit(1)
except Exception:
logging.exception("Caught an exception.")
Expand All @@ -214,9 +210,7 @@ def create_args():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument(
"node", help="Serial port device node e.g. /dev/ttyS1"
)
parser.add_argument("node", help="Serial port device node e.g. /dev/ttyS1")
parser.add_argument(
"--mode",
choices=["server", "client", "console"],
Expand Down

0 comments on commit d3842b7

Please sign in to comment.