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

@ -0,0 +1 @@
[{"filesystem":"//10.100.1.237/Bilder und Videos","mount_point":"/mnt/smb/thw/media","type":"cifs","options":["rw","nosuid","nodev","relatime","vers=2.1","cache=strict","username=iweinmann","uid=1000","noforceuid","gid=1000","noforcegid","addr=10.100.1.237","file_mode=0755","dir_mode=0755","iocharset=utf8","soft","nounix","serverino","mapposix","rsize=1048576","wsize=1048576","bsize=1048576","retrans=1","echo_interval=60","actimeo=1","closetimeo=1","user=ingo"]}]

View File

@ -0,0 +1 @@
//10.100.1.237/Bilder und Videos on /mnt/smb/thw/media type cifs (rw,nosuid,nodev,relatime,vers=2.1,cache=strict,username=iweinmann,uid=1000,noforceuid,gid=1000,noforcegid,addr=10.100.1.237,file_mode=0755,dir_mode=0755,iocharset=utf8,soft,nounix,serverino,mapposix,rsize=1048576,wsize=1048576,bsize=1048576,retrans=1,echo_interval=60,actimeo=1,closetimeo=1,user=ingo)

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: 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() 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 # output
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/mount.json'), 'r', encoding='utf-8') as f: 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()) 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: 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()) 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): 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) 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__': if __name__ == '__main__':
unittest.main() unittest.main()