mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-23 00:29:59 +02:00
fix filename with spaces for osx/bsd
This commit is contained in:
1
tests/fixtures/osx-10.14.6/stat-filename-with-spaces.json
vendored
Normal file
1
tests/fixtures/osx-10.14.6/stat-filename-with-spaces.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
[{"file":"file name with spaces.txt","unix_device":16777220,"inode":161929661,"flags":"-rw-r--r--","links":1,"user":"kbrazil","group":"staff","rdev":0,"size":0,"access_time":"Aug 13 15:03:52 2021","modify_time":"Aug 13 14:37:03 2021","change_time":"Aug 13 14:37:03 2021","birth_time":"Aug 13 14:37:03 2021","block_size":4096,"blocks":0,"unix_flags":"0","access_time_epoch":1628892232,"access_time_epoch_utc":null,"modify_time_epoch":1628890623,"modify_time_epoch_utc":null,"change_time_epoch":1628890623,"change_time_epoch_utc":null,"birth_time_epoch":1628890623,"birth_time_epoch_utc":null}]
|
2
tests/fixtures/osx-10.14.6/stat-filename-with-spaces.out
vendored
Normal file
2
tests/fixtures/osx-10.14.6/stat-filename-with-spaces.out
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
16777220 161929661 -rw-r--r-- 1 kbrazil staff 0 0 "Aug 13 15:03:52 2021" "Aug 13 14:37:03 2021" "Aug 13 14:37:03 2021" "Aug 13 14:37:03 2021" 4096 0 0 file name with spaces.txt
|
||||
|
@ -26,6 +26,9 @@ class MyTests(unittest.TestCase):
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/stat.out'), 'r', encoding='utf-8') as f:
|
||||
self.osx_10_14_6_stat = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/stat-filename-with-spaces.out'), 'r', encoding='utf-8') as f:
|
||||
self.osx_10_14_6_stat_filename_with_spaces = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/stat.out'), 'r', encoding='utf-8') as f:
|
||||
self.freebsd12_stat = f.read()
|
||||
|
||||
@ -39,6 +42,9 @@ class MyTests(unittest.TestCase):
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/stat.json'), 'r', encoding='utf-8') as f:
|
||||
self.osx_10_14_6_stat_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/stat-filename-with-spaces.json'), 'r', encoding='utf-8') as f:
|
||||
self.osx_10_14_6_stat_filename_with_spaces_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/freebsd12/stat.json'), 'r', encoding='utf-8') as f:
|
||||
self.freebsd12_stat_json = json.loads(f.read())
|
||||
|
||||
@ -66,6 +72,12 @@ class MyTests(unittest.TestCase):
|
||||
"""
|
||||
self.assertEqual(jc.parsers.stat.parse(self.osx_10_14_6_stat, quiet=True), self.osx_10_14_6_stat_json)
|
||||
|
||||
def test_stat_filename_with_spaces_osx_10_14_6(self):
|
||||
"""
|
||||
Test 'stat' filename with spaces on OSX 10.14.6
|
||||
"""
|
||||
self.assertEqual(jc.parsers.stat.parse(self.osx_10_14_6_stat_filename_with_spaces, quiet=True), self.osx_10_14_6_stat_filename_with_spaces_json)
|
||||
|
||||
def test_stat_freebsd12(self):
|
||||
"""
|
||||
Test 'stat /foo/*' on FreeBSD12
|
||||
|
Reference in New Issue
Block a user