Skip to content

Commit

Permalink
Cleanup tests and unused variables to make automated checks happy
Browse files Browse the repository at this point in the history
  • Loading branch information
pieqq committed Sep 24, 2024
1 parent cc45b31 commit 8af1477
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion providers/base/bin/wifi_nmcli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def main():
turn_down_nm_connections()
try:
args.func(args)
except Exception as e:
except Exception:

Check warning on line 394 in providers/base/bin/wifi_nmcli_test.py

View check run for this annotation

Codecov / codecov/patch

providers/base/bin/wifi_nmcli_test.py#L394

Added line #L394 was not covered by tests
# The test is not required to run as root, but root access is
# required for journal access so only attempt to print when e.g.
# running under Remote
Expand Down
6 changes: 3 additions & 3 deletions providers/base/tests/test_wifi_nmcli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ class TestWaitForConnected(unittest.TestCase):
"wifi_nmcli_test.sp.check_output",
MagicMock(
side_effect=[
b"100:connected\nTestESSID",
"100:connected\nTestESSID\n",
]
),
)
Expand All @@ -289,7 +289,7 @@ def test_wait_for_connected_success(self):

@patch(
"wifi_nmcli_test.sp.check_output",
MagicMock(return_value=b"30:disconnected\nTestESSID"),
MagicMock(return_value="30:disconnected\nTestESSID\n"),
)
@patch("wifi_nmcli_test.print_cmd", new=MagicMock())
def test_wait_for_connected_failure_due_to_timeout(self):
Expand All @@ -300,7 +300,7 @@ def test_wait_for_connected_failure_due_to_timeout(self):

@patch(
"wifi_nmcli_test.sp.check_output",
MagicMock(return_value=b"100:connected\nWrongESSID"),
MagicMock(return_value="100:connected\nWrongESSID\n"),
)
@patch("wifi_nmcli_test.print_cmd", new=MagicMock())
def test_wait_for_connected_failure_due_to_essid_mismatch(self):
Expand Down

0 comments on commit 8af1477

Please sign in to comment.