From 06811c3539b0d871e13e9b8d3b51f731d06fd2ce Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Wed, 10 Jun 2020 17:41:54 -0700 Subject: [PATCH] add test for no data --- tests/test_fstab.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_fstab.py b/tests/test_fstab.py index 3cbfc0f7..1e04ee2f 100644 --- a/tests/test_fstab.py +++ b/tests/test_fstab.py @@ -23,6 +23,12 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/fstab.json'), 'r', encoding='utf-8') as f: self.ubuntu_18_4_fstab_json = json.loads(f.read()) + def test_fstab_nodata(self): + """ + Test 'cat /etc/fstab' with no data + """ + self.assertEqual(jc.parsers.fstab.parse('', quiet=True), []) + def test_fstab_centos_7_7(self): """ Test 'cat /etc/fstab' on Centos 7.7