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 08:38:39 +02:00
1 parent f94c0a3171
commit f9fc4e3d06
3 files changed
+89 -81

No files matched your search

+4 -9
View File
@@ -3,12 +3,10 @@ from unittest.mock import MagicMock, patch
import pytest
import requests
from napalm.base.exceptions import ConnectionException
from napalm_zyxel import ZyxelVMGDriver
MOCK_BASIC_INFO = {
"ModelName": "VMG4005-B50A",
"SoftwareVersion": "V5.13(ABKS.1)C0",
@@ -117,7 +115,8 @@ class TestZyxelVMGDriver:
mock_crypto = MagicMock()
mock_crypto.encrypt_json.return_value = {"content": "ENC", "iv": "IV", "key": ""}
mock_crypto.decrypt_response.return_value = {
"result": "ZCFG_SUCCESS", "sessionkey": "12345"
"result": "ZCFG_SUCCESS",
"sessionkey": "12345",
}
mock_crypto.encrypt_aes_key_with_rsa.return_value = "ENC_KEY"
mock_crypto_cls.return_value = mock_crypto
@@ -127,12 +126,8 @@ class TestZyxelVMGDriver:
session.post.return_value = MockResponse(MOCK_LOGIN_RESPONSE)
with patch.object(self.driver, "_session", session, create=False):
with patch.object(
self.driver, "_get_rsa_pubkey", return_value=MOCK_RSA_KEY
):
with patch.object(
self.driver, "_get_basic_info", return_value=MOCK_BASIC_INFO
):
with patch.object(self.driver, "_get_rsa_pubkey", return_value=MOCK_RSA_KEY):
with patch.object(self.driver, "_get_basic_info", return_value=MOCK_BASIC_INFO):
self.driver._session = None
self.driver._crypto = None
self.driver._sessionkey = None