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:
1 parent
5b24675a12
commit
09029ca0a4
29 files changed
+985
-456
No files matched your search
+19
-13
@@ -23,16 +23,18 @@ REFUSED = json.loads((FIXTURES / MOCKUP / "STATUS.json").read_text())
|
||||
def x10(http):
|
||||
server = MockupServer(http, MOCKUP)
|
||||
for path, status in REFUSED.items():
|
||||
body = json.loads((FIXTURES / MOCKUP / path[len("/redfish/v1/"):] / "index.json")
|
||||
.read_text())
|
||||
body = json.loads(
|
||||
(FIXTURES / MOCKUP / path[len("/redfish/v1/") :] / "index.json").read_text()
|
||||
)
|
||||
server.override("GET", path, status, body)
|
||||
return server
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def driver(x10):
|
||||
d = RedfishDriver(BASE_URL.removeprefix("https://"), "netork", "secret",
|
||||
optional_args={"verify_ssl": False})
|
||||
d = RedfishDriver(
|
||||
BASE_URL.removeprefix("https://"), "netork", "secret", optional_args={"verify_ssl": False}
|
||||
)
|
||||
d.open()
|
||||
yield d
|
||||
d.close()
|
||||
@@ -65,10 +67,12 @@ def test_the_firmware_comes_from_the_manager_and_the_system_without_updateservic
|
||||
|
||||
|
||||
def test_the_missing_license_is_named_with_what_it_withholds(driver):
|
||||
assert driver.get_device_warnings() == [{
|
||||
"code": "bmc_license_partial",
|
||||
"meta": {"licenses": "DCMS", "parts": ["drives", "firmware inventory"]},
|
||||
}]
|
||||
assert driver.get_device_warnings() == [
|
||||
{
|
||||
"code": "bmc_license_partial",
|
||||
"meta": {"licenses": "DCMS", "parts": ["drives", "firmware inventory"]},
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
def test_the_power_actions_are_the_ones_the_bmc_advertises(driver):
|
||||
@@ -95,8 +99,10 @@ def test_the_sensors_and_the_event_log_read(driver):
|
||||
|
||||
|
||||
def test_the_missing_license_is_a_fact_with_what_it_withholds(driver):
|
||||
assert driver.get_licenses() == [{
|
||||
"name": "DCMS",
|
||||
"status": "missing",
|
||||
"withholds": ["drives", "firmware inventory"],
|
||||
}]
|
||||
assert driver.get_licenses() == [
|
||||
{
|
||||
"name": "DCMS",
|
||||
"status": "missing",
|
||||
"withholds": ["drives", "firmware inventory"],
|
||||
}
|
||||
]
|
||||
Reference in new issue
Block a user