mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-12-20 00:23:11 +02:00
iwconfig: add test with many interface
This commit is contained in:
@@ -12,6 +12,9 @@ class iwconfigTests(unittest.TestCase):
|
||||
with open(os.path.join(THIS_DIR, 'fixtures/generic/iwconfig.out'), 'r', encoding='utf-8') as f:
|
||||
iwconfig_output = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, 'fixtures/generic/iwconfig-many.out'), 'r', encoding='utf-8') as f:
|
||||
iwconfig_many_output = f.read()
|
||||
|
||||
# output
|
||||
with open(os.path.join(THIS_DIR, 'fixtures/generic/iwconfig.json'), 'r', encoding='utf-8') as f:
|
||||
iwconfig_json = json.loads(f.read())
|
||||
@@ -19,6 +22,9 @@ class iwconfigTests(unittest.TestCase):
|
||||
with open(os.path.join(THIS_DIR, 'fixtures/generic/iwconfig-raw.json'), 'r', encoding='utf-8') as f:
|
||||
iwconfig_raw_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, 'fixtures/generic/iwconfig-many.json'), 'r', encoding='utf-8') as f:
|
||||
iwconfig_many_json = json.loads(f.read())
|
||||
|
||||
|
||||
def test_iwconfig_nodata(self):
|
||||
"""
|
||||
@@ -38,5 +44,11 @@ class iwconfigTests(unittest.TestCase):
|
||||
"""
|
||||
self.assertEqual(jc.parsers.iwconfig.parse(self.iwconfig_output, quiet=True), self.iwconfig_json)
|
||||
|
||||
def test_iwconfig_many(self):
|
||||
"""
|
||||
Test 'iwconfig' many interface
|
||||
"""
|
||||
self.assertEqual(jc.parsers.iwconfig.parse(self.iwconfig_many_output, quiet=True), self.iwconfig_many_json)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user