diff --git a/changelog.txt b/changelog.txt index 8102a17e..cb7d673f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,9 @@ jc changelog +20200610 v1.11.5 +- Update airport_s parser to fix error on parsing empty data +- Add tests to all parsers for no data condition + 20200610 v1.11.4 - Update ls parser to fix error on parsing an empty directory diff --git a/tests/test_airport.py b/tests/test_airport.py index 91907515..67a0c16f 100644 --- a/tests/test_airport.py +++ b/tests/test_airport.py @@ -17,6 +17,12 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/airport-I.json'), 'r', encoding='utf-8') as f: self.osx_10_14_6_airport_I_json = json.loads(f.read()) + def test_airport_I_nodata(self): + """ + Test 'airport -I' with no data + """ + self.assertEqual(jc.parsers.airport.parse('', quiet=True), {}) + def test_airport_I_osx_10_14_6(self): """ Test 'airport -I' on OSX 10.14.6 diff --git a/tests/test_airport_s.py b/tests/test_airport_s.py index 2b964f01..fa228d5c 100644 --- a/tests/test_airport_s.py +++ b/tests/test_airport_s.py @@ -17,6 +17,12 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/airport-s.json'), 'r', encoding='utf-8') as f: self.osx_10_14_6_airport_s_json = json.loads(f.read()) + def test_airport_s_nodata(self): + """ + Test 'airport -s' with no data + """ + self.assertEqual(jc.parsers.airport_s.parse('', quiet=True), []) + def test_airport_s_osx_10_14_6(self): """ Test 'airport -s' on OSX 10.14.6