1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00

add mount test

This commit is contained in:
Kelly Brazil
2024-06-18 17:34:17 -07:00
parent 9eb4df34b1
commit c68c919024
3 changed files with 15 additions and 0 deletions

View File

@ -27,6 +27,10 @@ class MyTests(unittest.TestCase):
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/mount-spaces-in-mountpoint.out'), 'r', encoding='utf-8') as f:
generic_mount_spaces_in_mountpoint = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/mount-spaces-in-filename.out'), 'r', encoding='utf-8') as f:
generic_mount_spaces_in_filename = f.read()
# output
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/mount.json'), 'r', encoding='utf-8') as f:
centos_7_7_mount_json = json.loads(f.read())
@ -46,6 +50,9 @@ class MyTests(unittest.TestCase):
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/mount-spaces-in-mountpoint.json'), 'r', encoding='utf-8') as f:
generic_mount_spaces_in_mountpoint_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/mount-spaces-in-filename.json'), 'r', encoding='utf-8') as f:
generic_mount_spaces_in_filename_json = json.loads(f.read())
def test_mount_nodata(self):
"""
@ -89,6 +96,12 @@ class MyTests(unittest.TestCase):
"""
self.assertEqual(jc.parsers.mount.parse(self.generic_mount_spaces_in_mountpoint, quiet=True), self.generic_mount_spaces_in_mountpoint_json)
def test_mount_spaces_in_filename(self):
"""
Test 'mount' with spaces in the filename
"""
self.assertEqual(jc.parsers.mount.parse(self.generic_mount_spaces_in_filename, quiet=True), self.generic_mount_spaces_in_filename_json)
if __name__ == '__main__':
unittest.main()