style: ruff format and the lint rules of the driver standard

Mechanical: ruff format, and ruff check --fix with the rule set every NAPALM
driver uses (E, F, I, UP, B at line length 100, Python 3.10). What ruff
cannot fix comes in the next commit.
This commit is contained in:
Christian Manivong committed 2026-10-23 12:08:18 +02:00
1 parent 3a991970b8
commit 991cae7e8d
2 files changed
+9 -9

No files matched your search

+3 -5
View File
@@ -105,9 +105,7 @@ class TestRolesDoNotShadowLinux:
owner = next(k for k in QnapQtsDriver.__mro__ if method in k.__dict__)
assert owner is LinuxDriver
@pytest.mark.parametrize(
"method", ["get_packages", "install_package", "uninstall_package"]
)
@pytest.mark.parametrize("method", ["get_packages", "install_package", "uninstall_package"])
def test_package_surface_is_refused_deliberately(self, method):
"""QTS has no apt/dnf, so LinuxDriver's versions must not be inherited
silently -- this driver overrides them to refuse."""
@@ -117,7 +115,8 @@ class TestRolesDoNotShadowLinux:
def test_no_forwarding_methods_remain(self):
"""A forwarder here would mean the shadowing came back."""
own = {
name for name, val in vars(QnapQtsDriver).items()
name
for name, val in vars(QnapQtsDriver).items()
if callable(val) and not name.startswith("__")
}
assert "get_services" not in own
@@ -216,7 +215,6 @@ def test_services_cannot_be_controlled():
assert not callable(getattr(QnapQtsDriver, "manage_service", None))
def test_updates_are_not_read_or_applied_here():
"""QTS has no apt, dnf or opkg: the readers inherited from LinuxDriver find no
package manager, and QPKG updates are not implemented. Saying so keeps QNAP out