Skip to content

Commit

Permalink
Fix format to fit black
Browse files Browse the repository at this point in the history
  • Loading branch information
rickwu666666 committed Aug 6, 2024
1 parent de2eb56 commit 3b6473a
Showing 1 changed file with 11 additions and 33 deletions.
44 changes: 11 additions & 33 deletions providers/resource/tests/test_wifi_interface_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ def test_run_command_failure(self, mock_run):
with self.assertRaises(SystemError):
run_command(["echo", "hello"])

@patch(
"wifi_interface_mode.run_command"
)
@patch("wifi_interface_mode.run_command")
def test_get_interfaces(self, mock_run_command):
mock_run_command.return_value = """
phy#0
Expand All @@ -39,9 +37,7 @@ def test_get_interfaces(self, mock_run_command):
result = get_interfaces()
self.assertEqual(result, expected)

@patch(
"wifi_interface_mode.run_command"
)
@patch("wifi_interface_mode.run_command")
def test_get_wiphy_info_with_one_phy(self, mock_run_command):
mock_run_command.return_value = """Wiphy phy0
Supported interface modes:
Expand All @@ -52,17 +48,13 @@ def test_get_wiphy_info_with_one_phy(self, mock_run_command):
expected = [
(
"0",
["managed",
"AP/VLAN",
"monitor"],
["managed", "AP/VLAN", "monitor"],
),
]
result = get_wiphy_info()
self.assertEqual(result, expected)

@patch(
"wifi_interface_mode.run_command"
)
@patch("wifi_interface_mode.run_command")
def test_get_wiphy_info_with_phy_start_with_mwi(self, mock_run_command):
mock_run_command.return_value = """Wiphy mwiphy0
Supported interface modes:
Expand All @@ -73,17 +65,13 @@ def test_get_wiphy_info_with_phy_start_with_mwi(self, mock_run_command):
expected = [
(
"0",
["managed",
"AP/VLAN",
"monitor"],
["managed", "AP/VLAN", "monitor"],
),
]
result = get_wiphy_info()
self.assertEqual(result, expected)

@patch(
"wifi_interface_mode.run_command"
)
@patch("wifi_interface_mode.run_command")
def test_get_wiphy_info_with_two_phy(self, mock_run_command):
mock_run_command.return_value = """Wiphy phy0
Supported interface modes:
Expand All @@ -99,37 +87,27 @@ def test_get_wiphy_info_with_two_phy(self, mock_run_command):
expected = [
(
"0",
["managed",
"AP/VLAN",
"monitor"],
["managed", "AP/VLAN", "monitor"],
),
(
"1",
["managed",
"AP/VLAN",
"P2P-client"],
["managed", "AP/VLAN", "P2P-client"],
),
]
result = get_wiphy_info()
self.assertEqual(result, expected)

@patch(
"wifi_interface_mode.run_command"
)
@patch("wifi_interface_mode.run_command")
def test_print_supported_modes(self, mock_run_command):
interfaces = [("0", "wlan0"), ("1", "wlan1")]
wiphy_ids = [
(
"0",
["managed",
"AP/VLAN",
"monitor"],
["managed", "AP/VLAN", "monitor"],
),
(
"1",
["managed",
"AP/VLAN",
"P2P-client"],
["managed", "AP/VLAN", "P2P-client"],
),
]

Expand Down

0 comments on commit 3b6473a

Please sign in to comment.