3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 14:49:24 +01:00

auto-t: use get_ordered_network call in remaining tests

This hopefully wraps up the API migration to get_ordered_network
rather than the plural (get_ordered_networks) version.
This commit is contained in:
James Prestwood 2019-01-08 14:43:57 -08:00 committed by Denis Kenzior
parent edbe38103a
commit ae47d12520
5 changed files with 4 additions and 24 deletions

View File

@ -75,7 +75,6 @@ class Test(unittest.TestCase):
wd.wait_for_object_condition(dev2, condition) wd.wait_for_object_condition(dev2, condition)
ordered_networks = dev2.get_ordered_networks() ordered_networks = dev2.get_ordered_networks()
self.assertEqual(len(ordered_networks), 2)
networks = { n.name: n for n in ordered_networks } networks = { n.name: n for n in ordered_networks }
self.assertEqual(networks['TestAP1'].type, NetworkType.psk) self.assertEqual(networks['TestAP1'].type, NetworkType.psk)
self.assertEqual(networks['TestAP2'].type, NetworkType.psk) self.assertEqual(networks['TestAP2'].type, NetworkType.psk)

View File

@ -68,7 +68,6 @@ class Test(unittest.TestCase):
wd.wait_for_object_condition(dev2, condition) wd.wait_for_object_condition(dev2, condition)
ordered_networks = dev2.get_ordered_networks() ordered_networks = dev2.get_ordered_networks()
self.assertEqual(len(ordered_networks), 2)
networks = { n.name: n for n in ordered_networks } networks = { n.name: n for n in ordered_networks }
self.assertEqual(networks['TestAP1'].type, NetworkType.psk) self.assertEqual(networks['TestAP1'].type, NetworkType.psk)
self.assertEqual(networks['TestAP2'].type, NetworkType.psk) self.assertEqual(networks['TestAP2'].type, NetworkType.psk)

View File

@ -12,15 +12,7 @@ from iwd import NetworkType
class TestConnectAutoconnect(unittest.TestCase): class TestConnectAutoconnect(unittest.TestCase):
def check_connect(self, wd, device, ssid, throws): def check_connect(self, wd, device, ssid, throws):
ordered_networks = device.get_ordered_networks() ordered_network = device.get_ordered_network(ssid)
ordered_network = None
for o_n in ordered_networks:
if o_n.name == ssid:
ordered_network = o_n
break
self.assertEqual(ordered_network.name, ssid)
condition = 'not obj.connected' condition = 'not obj.connected'
wd.wait_for_object_condition(ordered_network.network_object, condition) wd.wait_for_object_condition(ordered_network.network_object, condition)
@ -43,10 +35,8 @@ class TestConnectAutoconnect(unittest.TestCase):
condition = 'obj.connected_network is not None' condition = 'obj.connected_network is not None'
wd.wait_for_object_condition(device, condition) wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_networks()[0] ordered_network = device.get_ordered_network(ssid)
self.assertIsNotNone(ordered_network)
self.assertEqual(ordered_network.name, ssid)
self.assertTrue(ordered_network.network_object.connected) self.assertTrue(ordered_network.network_object.connected)
device.disconnect() device.disconnect()

View File

@ -121,11 +121,7 @@ class Test(unittest.TestCase):
condition = 'not obj.scanning' condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition) wd.wait_for_object_condition(device, condition)
ordered_networks = device.get_ordered_networks() ordered_network = device.get_ordered_network("TestFT")
self.assertEqual(len(ordered_networks), 1)
ordered_network = ordered_networks[0]
self.assertEqual(ordered_network.name, "TestFT")
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)
self.assertEqual(ordered_network.signal_strength, -2000) self.assertEqual(ordered_network.signal_strength, -2000)

View File

@ -130,11 +130,7 @@ class Test(unittest.TestCase):
condition = 'not obj.scanning' condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition) wd.wait_for_object_condition(device, condition)
ordered_networks = device.get_ordered_networks() ordered_network = device.get_ordered_network("TestFT")
self.assertEqual(len(ordered_networks), 1)
ordered_network = ordered_networks[0]
self.assertEqual(ordered_network.name, "TestFT")
self.assertEqual(ordered_network.type, NetworkType.psk) self.assertEqual(ordered_network.type, NetworkType.psk)
self.assertEqual(ordered_network.signal_strength, -2000) self.assertEqual(ordered_network.signal_strength, -2000)