コード例 #1
0
ファイル: test_parsing.py プロジェクト: oe-mirrors/wifi
 def test_normalized_frequency(self):
     cell = Cell.from_string(FREQUENCY_5G)
     self.assertEqual(cell.frequency_norm, '5Ghz')
     cell = Cell.from_string(IWLIST_SCAN_WPA2)
     self.assertEqual(cell.frequency_norm, '2.4Ghz')
     cell = Cell.from_string(FREQUENCY_UNSUPPORTED)
     self.assertIsNone(cell.frequency_norm)
コード例 #2
0
ファイル: test_parsing.py プロジェクト: oe-mirrors/wifi
 def test_bssid(self):
     # This seems like a useless test, yet if bssid is refactored and not
     # in sync with address attribute, this will alert us.
     cell = Cell.from_string(ALTERNATIVE_OUTPUT)
     self.assertEqual(cell.address, cell.bssid)
     cell.bssid = 'AC:22:05:25:3B:6A'
     self.assertEqual('AC:22:05:25:3B:6A', cell.address)
コード例 #3
0
ファイル: test_parsing.py プロジェクト: oe-mirrors/wifi
 def test_no_encryption(self):
     cell = Cell.from_string(IWLIST_SCAN_NO_ENCRYPTION)
     self.assertFalse(cell.encrypted)
     self.assertEqual('My Wireless Network', cell.ssid)
     self.assertEqual(-51, cell.signal)
     self.assertEqual('59/70', cell.quality)
     self.assertEqual('2.437 GHz', cell.frequency)
     self.assertEqual('Master', cell.mode)
     self.assertEqual(6, cell.channel)
コード例 #4
0
ファイル: test_parsing.py プロジェクト: DanLipsitt/wifi
 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)
コード例 #5
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)
コード例 #6
0
ファイル: test_parsing.py プロジェクト: DanLipsitt/wifi
 def test_wpa2(self):
     cell = Cell.from_string(IWLIST_SCAN_WPA2)
     self.assertTrue(cell.encrypted)
     self.assertEqual(cell.encryption_type, 'wpa2')
コード例 #7
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)
コード例 #8
0
ファイル: test_parsing.py プロジェクト: Develoman/wifi
 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)
コード例 #9
0
 def test_noname_cell(self):
     cell = Cell.from_string(NONAME_WIRELESS_NETWORK)
     self.assertEqual(cell.ssid, '')
コード例 #10
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)
コード例 #11
0
 def test_wep(self):
     cell = Cell.from_string(IWLIST_SCAN_WEP)
     self.assertTrue(cell.encrypted)
     self.assertEqual(cell.encryption_type, 'wep')
コード例 #12
0
ファイル: test_parsing.py プロジェクト: oe-mirrors/wifi
 def test_pairwise_ciphers(self):
     cell = Cell.from_string(IWLIST_SCAN_WPA_WPA2_DUAL_CIPHERS)
     self.assertListEqual(['CCMP', 'TKIP'], cell.pairwise_ciphers)
コード例 #13
0
ファイル: test_parsing.py プロジェクト: oe-mirrors/wifi
 def test_wpa_enterprise(self):
     cell = Cell.from_string(IWLIST_SCAN_WPA_ENTERPRISE)
     self.assertTrue(cell.encrypted)
     self.assertEqual('wpa-enterprise', cell.encryption_type)
コード例 #14
0
ファイル: test_parsing.py プロジェクト: oe-mirrors/wifi
 def test_wpa_wpa2(self):
     cell = Cell.from_string(IWLIST_SCAN_WPA_WPA2)
     self.assertTrue(cell.encrypted)
     self.assertEqual('wpa/wpa2', cell.encryption_type)
コード例 #15
0
ファイル: test_parsing.py プロジェクト: oe-mirrors/wifi
 def test_unimplemented(self):
     cell = Cell.from_string(IWLIST_SCAN_WPA_ENTERPRISE)
     with self.assertRaises(NotImplementedError):
         cell.gen_wpasup_cfg('supersecret')
コード例 #16
0
ファイル: test_parsing.py プロジェクト: oe-mirrors/wifi
 def test_open_ap(self):
     cell = Cell.from_string(IWLIST_SCAN_NO_ENCRYPTION)
     self.assertEqual(WSCFG_OPEN, cell.gen_wpasup_cfg())
コード例 #17
0
ファイル: test_parsing.py プロジェクト: oe-mirrors/wifi
 def test_wpa2_psk(self):
     cell = Cell.from_string(IWLIST_SCAN_WPA2)
     self.assertEqual(WSCFG_WPA2, cell.gen_wpasup_cfg('supersecret'))
コード例 #18
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)
コード例 #19
0
ファイル: test_parsing.py プロジェクト: oe-mirrors/wifi
 def test_group_cipher(self):
     cell = Cell.from_string(IWLIST_SCAN_WPA2)
     self.assertEqual('CCMP', cell.group_cipher)
コード例 #20
0
ファイル: test_parsing.py プロジェクト: Evanito/wifi
 def test_noise_no_data(self):
     cell = Cell.from_string(IWLIST_SCAN_NO_ENCRYPTION)
     self.assertEqual(cell.noise, None)
コード例 #21
0
ファイル: test_parsing.py プロジェクト: Evanito/wifi
 def test_noise_data_present(self):
     cell = Cell.from_string(LIST_INDEX_ERROR)
     self.assertEqual(cell.noise, -92)
コード例 #22
0
ファイル: test_parsing.py プロジェクト: oe-mirrors/wifi
 def test_no_channel_output(self):
     cell = Cell.from_string(NO_CHANNEL_OUTPUT)
     self.assertEqual(11, cell.channel)
コード例 #23
0
ファイル: test_parsing.py プロジェクト: oe-mirrors/wifi
 def test_list_index_error(self):
     cell = Cell.from_string(LIST_INDEX_ERROR)
コード例 #24
0
ファイル: test_parsing.py プロジェクト: oe-mirrors/wifi
 def test_frequency_no_channel_output(self):
     cell = Cell.from_string(FREQUENCY_NO_CHANNEL_OUTPUT)
     self.assertEqual(149, cell.channel)
コード例 #25
0
 def test_wpa1(self):
     cell = Cell.from_string(IWLIST_SCAN_WPA1)
     self.assertTrue(cell.encrypted)
     self.assertEqual(cell.encryption_type, 'wpa')
コード例 #26
0
ファイル: test_parsing.py プロジェクト: Develoman/wifi
 def test_noname_cell(self):
     cell = Cell.from_string(NONAME_WIRELESS_NETWORK)
     self.assertEqual(cell.ssid, '')
コード例 #27
0
 def test_signal_level_out_of_sixty(self):
     cell = Cell.from_string(ALTERNATIVE_OUTPUT2)
     self.assertEqual(cell.signal, -71)
コード例 #28
0
ファイル: test_parsing.py プロジェクト: Develoman/wifi
 def test_list_index_error(self):
     # https://github.com/rockymeza/wifi/issues/42
     cell = Cell.from_string(LIST_INDEX_ERROR)
コード例 #29
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)
コード例 #30
0
ファイル: test_parsing.py プロジェクト: Develoman/wifi
 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)
コード例 #31
0
ファイル: test_parsing.py プロジェクト: Develoman/wifi
 def test_signal_level_out_of_sixty(self):
     cell = Cell.from_string(ALTERNATIVE_OUTPUT2)
     self.assertEqual(cell.signal, -71)
コード例 #32
0
 def test_list_index_error(self):
     # https://github.com/rockymeza/wifi/issues/42
     cell = Cell.from_string(LIST_INDEX_ERROR)
コード例 #33
0
ファイル: test_parsing.py プロジェクト: Develoman/wifi
 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)
コード例 #34
0
ファイル: test_parsing.py プロジェクト: oe-mirrors/wifi
 def test_absolute_quality(self):
     # https://github.com/rockymeza/wifi/pull/45
     cell = Cell.from_string(ABSOLUTE_QUALITY)
     self.assertEqual('38/100', cell.quality)
     self.assertEqual(-92, cell.signal)
コード例 #35
0
ファイル: test_parsing.py プロジェクト: Develoman/wifi
 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)
コード例 #36
0
ファイル: test_parsing.py プロジェクト: oe-mirrors/wifi
 def test_blank_ssid(self):
     cell = Cell.from_string(NO_SSID_AT_ALL)
     self.assertEqual(None, cell.ssid)
コード例 #37
0
ファイル: test_parsing.py プロジェクト: DanLipsitt/wifi
 def test_wep(self):
     cell = Cell.from_string(IWLIST_SCAN_WEP)
     self.assertTrue(cell.encrypted)
     self.assertEqual(cell.encryption_type, 'wep')
コード例 #38
0
ファイル: test_parsing.py プロジェクト: oe-mirrors/wifi
 def test_noise_no_data(self):
     cell = Cell.from_string(IWLIST_SCAN_NO_ENCRYPTION)
     self.assertEqual(None, cell.noise)
コード例 #39
0
ファイル: test_parsing.py プロジェクト: oe-mirrors/wifi
 def test_noise_data_present(self):
     cell = Cell.from_string(LIST_INDEX_ERROR)
     self.assertEqual(-92, cell.noise)
コード例 #40
0
ファイル: test_parsing.py プロジェクト: Evanito/wifi
 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)