storage/detect+test file systems with collision: fix to catch HFS+ (MacOS)
This commit is contained in:
@@ -222,7 +222,7 @@ class TestMultiFileSystem(BaseTest):
|
||||
"""Test for colliding files on file systems."""
|
||||
caplog.set_level(logging.WARNING)
|
||||
self.configure({"logging": {"request_content_on_debug": "False"}})
|
||||
fs_colliding_free = pathutils.path_is_collision_free(tempfile.mkdtemp())
|
||||
fs_collision_free = pathutils.path_is_collision_free_case_sensitive(tempfile.mkdtemp())
|
||||
file_item = "EvEnT1.iCs"
|
||||
path_coll = "/calendar.ics/"
|
||||
self.mkcalendar(path_coll)
|
||||
@@ -232,11 +232,11 @@ class TestMultiFileSystem(BaseTest):
|
||||
path_lc = os.path.join(path_coll, file_item.lower())
|
||||
self.put(path_item, event)
|
||||
self.put(path_uc, event, check=409)
|
||||
if not fs_colliding_free:
|
||||
if not fs_collision_free:
|
||||
logs = caplog.messages
|
||||
assert len([log for log in logs if "File name collision" in log]) == 1
|
||||
self.put(path_lc, event, check=409)
|
||||
if not fs_colliding_free:
|
||||
if not fs_collision_free:
|
||||
logs = caplog.messages
|
||||
assert len([log for log in logs if "File name collision" in log]) == 2
|
||||
|
||||
@@ -244,16 +244,16 @@ class TestMultiFileSystem(BaseTest):
|
||||
"""Test for colliding dirs on file systems."""
|
||||
caplog.set_level(logging.WARNING)
|
||||
self.configure({"logging": {"request_content_on_debug": "False"}})
|
||||
fs_colliding_free = pathutils.path_is_collision_free(tempfile.mkdtemp())
|
||||
fs_collision_free = pathutils.path_is_collision_free_case_sensitive(tempfile.mkdtemp())
|
||||
path_coll = "/CaLeNdAr.ics/"
|
||||
self.mkcalendar(path_coll)
|
||||
if fs_colliding_free:
|
||||
if fs_collision_free:
|
||||
self.mkcalendar(path_coll.lower(), check=201)
|
||||
else:
|
||||
self.mkcalendar(path_coll.lower(), check=409)
|
||||
logs = caplog.messages
|
||||
assert len([log for log in logs if "File name collision" in log]) == 1
|
||||
if fs_colliding_free:
|
||||
if fs_collision_free:
|
||||
self.mkcalendar(path_coll.upper(), check=201)
|
||||
else:
|
||||
self.mkcalendar(path_coll.upper(), check=409)
|
||||
@@ -264,17 +264,17 @@ class TestMultiFileSystem(BaseTest):
|
||||
"""Test for colliding dirs (shortname) on file systems."""
|
||||
caplog.set_level(logging.WARNING)
|
||||
self.configure({"logging": {"request_content_on_debug": "False"}})
|
||||
fs_colliding_free = pathutils.path_is_collision_free(tempfile.mkdtemp())
|
||||
fs_collision_free = pathutils.path_is_collision_free_no_short_filename(tempfile.mkdtemp())
|
||||
path_coll = "/calendarlongname.ics/"
|
||||
path_coll_short = "/calend~1.ics/"
|
||||
self.mkcalendar(path_coll)
|
||||
if fs_colliding_free:
|
||||
if fs_collision_free:
|
||||
self.mkcalendar(path_coll_short.lower(), check=201)
|
||||
else:
|
||||
self.mkcalendar(path_coll_short.lower(), check=409)
|
||||
logs = caplog.messages
|
||||
assert len([log for log in logs if "File name collision" in log]) == 1
|
||||
if fs_colliding_free:
|
||||
if fs_collision_free:
|
||||
self.mkcalendar(path_coll_short.upper(), check=201)
|
||||
else:
|
||||
self.mkcalendar(path_coll_short.upper(), check=409)
|
||||
|
||||
Reference in New Issue
Block a user