From 12310eb00b395fd84f4cf3cd03113ed14dd3f6e9 Mon Sep 17 00:00:00 2001 From: James Garner Date: Wed, 18 Sep 2024 10:59:16 +1200 Subject: [PATCH] Add periods and newlines to make ruff happy --- tests/unit/test_snap.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/unit/test_snap.py b/tests/unit/test_snap.py index 7caaab4f..896aadf1 100644 --- a/tests/unit/test_snap.py +++ b/tests/unit/test_snap.py @@ -638,7 +638,7 @@ def test_fake_socket(self): @patch("builtins.hasattr", return_value=False) def test_not_implemented_raised_when_missing_socket_af_unix(self, _: MagicMock): - """Assert NotImplementedError raised when missing socket.AF_UNIX""" + """Assert NotImplementedError raised when missing socket.AF_UNIX.""" s = snap._UnixSocketConnection("localhost") with self.assertRaises(NotImplementedError): s.connect() # hasattr(socket, "AF_UNIX") == False @@ -852,8 +852,9 @@ def test_snap_get(self): An invalid key will raise an error if typed=False, but return None if typed=True. """ + def fake_snap(command: str, optargs: Optional[Iterable[str]] = None) -> str: - """Snap._snap would normally call subprocess.check_output(["snap", ...], ...) + """Snap._snap would normally call subprocess.check_output(["snap", ...], ...). Here we only handle the "get" commands generated by Snap.get: ["snap", "get", "-d"] -- equivalent to (None, typed=True)