fix tests

This commit is contained in:
Georges-Antoine Assi
2026-01-19 12:20:11 -05:00
parent f48cf10e43
commit dd5935f50c

View File

@@ -83,7 +83,7 @@ class TestFSHandler:
def test_sanitize_filename_too_long(self, handler: FSHandler):
"""Test filename sanitization with too long filenames"""
long_name = "a" * (FILE_NAME_MAX_LENGTH + 1)
with pytest.raises(ValueError, match="Filename exceeds maximum length"):
with pytest.raises(ValueError, match="Filename .* exceeds maximum length"):
handler._sanitize_filename(long_name)
def test_validate_path_valid(self, handler: FSHandler):
@@ -110,7 +110,7 @@ class TestFSHandler:
for path in malicious_paths:
with pytest.raises(
ValueError, match="Path contains invalid parent directory references"
ValueError, match="Path .* contains invalid parent directory references"
):
handler.validate_path(path)