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:
1 parent
7f2ae6ac58
commit
a212bc8715
14 files changed
+322
-239
No files matched your search
@@ -86,7 +86,9 @@ class TestRebootHost:
|
||||
|
||||
def test_detached_so_the_answer_comes_back_first(self):
|
||||
drv = _driver()
|
||||
with patch("napalm_openwrt.openwrt.run_on_transport", return_value=CommandResult("", "", 0)) as run:
|
||||
with patch(
|
||||
"napalm_openwrt.openwrt.run_on_transport", return_value=CommandResult("", "", 0)
|
||||
) as run:
|
||||
drv.reboot_host()
|
||||
|
||||
command = run.call_args.args[1]
|
||||
@@ -96,8 +98,9 @@ class TestRebootHost:
|
||||
def test_a_refusal_is_raised(self):
|
||||
drv = _driver()
|
||||
failed = CommandResult("", "reboot: Operation not permitted", 1)
|
||||
with patch("napalm_openwrt.openwrt.run_on_transport", return_value=failed), pytest.raises(
|
||||
RuntimeError, match="not permitted"
|
||||
with (
|
||||
patch("napalm_openwrt.openwrt.run_on_transport", return_value=failed),
|
||||
pytest.raises(RuntimeError, match="not permitted"),
|
||||
):
|
||||
drv.reboot_host()
|
||||
|
||||
|
||||
Reference in new issue
Block a user