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). Mapping and
Iterable come from collections.abc, imports are sorted. What ruff cannot
fix comes in the next commit.
This commit is contained in:
Christian Manivong committed 2026-10-23 08:39:45 +02:00
1 parent 5b24675a12
commit 09029ca0a4
29 files changed
+985 -456

No files matched your search

+33 -8
View File
@@ -34,14 +34,39 @@ def test_account_defaults():
def test_to_napalm_users(rackmount):
accounts = [parse_account(rackmount(f"/redfish/v1/AccountService/Accounts/{i}"))
for i in (1, 2)]
accounts.append({"id": "3", "username": "netork", "role_id": "ReadOnly", "enabled": True,
"locked": False, "account_types": []})
accounts.append({"id": "4", "username": "ops", "role_id": "Operator", "enabled": False,
"locked": False, "account_types": []})
accounts.append({"id": "5", "username": "custom", "role_id": "OemSpecial", "enabled": True,
"locked": False, "account_types": []})
accounts = [
parse_account(rackmount(f"/redfish/v1/AccountService/Accounts/{i}")) for i in (1, 2)
]
accounts.append(
{
"id": "3",
"username": "netork",
"role_id": "ReadOnly",
"enabled": True,
"locked": False,
"account_types": [],
}
)
accounts.append(
{
"id": "4",
"username": "ops",
"role_id": "Operator",
"enabled": False,
"locked": False,
"account_types": [],
}
)
accounts.append(
{
"id": "5",
"username": "custom",
"role_id": "OemSpecial",
"enabled": True,
"locked": False,
"account_types": [],
}
)
accounts.append(None)
assert to_napalm_users(accounts) == {
"Administrator": {"level": 15, "password": "", "sshkeys": []},