Esempio n. 1
0
 def test_no_encryption(self):
     cell = Cell.from_string(IWLIST_SCAN_NO_ENCRYPTION)
     self.assertFalse(cell.encrypted)
     self.assertEqual(cell.ssid, 'My Wireless Network')
     self.assertEqual(cell.signal, -51)
     self.assertEqual(cell.quality, '59/70')
     self.assertEqual(cell.frequency, '2.437 GHz')
     self.assertEqual(cell.mode, 'Master')
     self.assertEqual(cell.channel, 6)
Esempio n. 2
0
    def test_empty_init(self):
        tcell = Cell()

        for field, value in self.fields.items():
            self.assertEqual(value, getattr(tcell, field))
Esempio n. 3
0
 def test_noise_data_present(self):
     cell = Cell.from_string(LIST_INDEX_ERROR)
     self.assertEqual(cell.noise, -92)
Esempio n. 4
0
 def test_noise_no_data(self):
     cell = Cell.from_string(IWLIST_SCAN_NO_ENCRYPTION)
     self.assertEqual(cell.noise, None)
Esempio n. 5
0
 def test_blank_ssid(self):
     # https://github.com/rockymeza/wifi/issues/86
     cell = Cell.from_string(NO_SSID_AT_ALL)
     self.assertEqual(cell.ssid, None)
Esempio n. 6
0
 def test_frequency_no_channel_output(self):
     # https://github.com/rockymeza/wifi/issues/39
     cell = Cell.from_string(FREQUENCY_NO_CHANNEL_OUTPUT)
     self.assertEqual(cell.channel, 149)
Esempio n. 7
0
 def test_absolute_quality(self):
     # https://github.com/rockymeza/wifi/pull/45
     cell = Cell.from_string(ABSOLUTE_QUALITY)
     self.assertEqual(cell.quality, '38/100')
     self.assertEqual(cell.signal, -92)
Esempio n. 8
0
 def test_no_channel_output(self):
     # https://github.com/rockymeza/wifi/issues/24
     cell = Cell.from_string(NO_CHANNEL_OUTPUT)
     self.assertEqual(cell.channel, 11)
Esempio n. 9
0
 def test_list_index_error(self):
     # https://github.com/rockymeza/wifi/issues/42
     cell = Cell.from_string(LIST_INDEX_ERROR)
Esempio n. 10
0
 def test_noname_cell(self):
     cell = Cell.from_string(NONAME_WIRELESS_NETWORK)
     self.assertEqual(cell.ssid, '')
Esempio n. 11
0
 def test_signal_level_out_of_sixty(self):
     cell = Cell.from_string(ALTERNATIVE_OUTPUT2)
     self.assertEqual(cell.signal, -71)
Esempio n. 12
0
 def test_alternative_iwlist_output(self):
     # https://github.com/rockymeza/wifi/issues/12
     cell = Cell.from_string(ALTERNATIVE_OUTPUT)
     self.assertEqual(cell.quality, '78/100')
     self.assertEqual(cell.signal, -92)
Esempio n. 13
0
 def test_wpa1(self):
     cell = Cell.from_string(IWLIST_SCAN_WPA1)
     self.assertTrue(cell.encrypted)
     self.assertEqual(cell.encryption_type, 'wpa')
Esempio n. 14
0
 def test_wep(self):
     cell = Cell.from_string(IWLIST_SCAN_WEP)
     self.assertTrue(cell.encrypted)
     self.assertEqual(cell.encryption_type, 'wep')