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)