-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: [wifiscan] fixes wifiscan parsing problem + test
- Loading branch information
1 parent
e7e0fbd
commit f709608
Showing
2 changed files
with
66 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import os | ||
import unittest | ||
|
||
from parsers.wifiscan import parsewifiscan | ||
|
||
|
||
class TestParsersWifiScan(unittest.TestCase): | ||
|
||
log_root_path = 'tests/testdata/iOS15/sysdiagnose_2023.05.24_13-29-15-0700_iPhone-OS_iPhone_19H349/' | ||
log_files = [ | ||
"WiFi/wifi_scan.txt" | ||
] | ||
|
||
def test_parsewifiscan(self): | ||
files = [os.path.join(self.log_root_path, log_file) for log_file in self.log_files] | ||
result = parsewifiscan(files) | ||
self.assertGreater(len(result), 0) | ||
self.assertTrue('total' in result[0]) | ||
|
||
for item in result: | ||
if 'total' in item: | ||
continue | ||
self.assertTrue('ssid' in item) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |