Merge pull request #208343 from bjornfor/nixos-test-driver-use-ascii-quotes

nixos/test-driver: use ASCII single quotes everywhere
This commit is contained in:
Jacek Galowicz 2022-12-30 18:14:26 +01:00 committed by GitHub
commit 506d2553f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -491,14 +491,14 @@ class Machine:
def require_unit_state(self, unit: str, require_state: str = "active") -> None: def require_unit_state(self, unit: str, require_state: str = "active") -> None:
with self.nested( with self.nested(
f"checking if unit {unit} has reached state '{require_state}'" f"checking if unit '{unit}' has reached state '{require_state}'"
): ):
info = self.get_unit_info(unit) info = self.get_unit_info(unit)
state = info["ActiveState"] state = info["ActiveState"]
if state != require_state: if state != require_state:
raise Exception( raise Exception(
f"Expected unit {unit} to to be in state " f"Expected unit '{unit}' to to be in state "
f"'{require_state}' but it is in state {state}" f"'{require_state}' but it is in state '{state}'"
) )
def _next_newline_closed_block_from_shell(self) -> str: def _next_newline_closed_block_from_shell(self) -> str:
@ -676,7 +676,7 @@ class Machine:
retry(tty_matches) retry(tty_matches)
def send_chars(self, chars: str, delay: Optional[float] = 0.01) -> None: def send_chars(self, chars: str, delay: Optional[float] = 0.01) -> None:
with self.nested(f"sending keys {chars}"): with self.nested(f"sending keys '{chars}'"):
for char in chars: for char in chars:
self.send_key(char, delay) self.send_key(char, delay)
@ -687,7 +687,7 @@ class Machine:
status, _ = self.execute(f"test -e {filename}") status, _ = self.execute(f"test -e {filename}")
return status == 0 return status == 0
with self.nested(f"waiting for file {filename}"): with self.nested(f"waiting for file '{filename}'"):
retry(check_file) retry(check_file)
def wait_for_open_port(self, port: int, addr: str = "localhost") -> None: def wait_for_open_port(self, port: int, addr: str = "localhost") -> None: