Test edge case with symlinks (if supported).
()
| 290 | |
| 291 | |
| 292 | def test_edge_case_symlinks() -> None: |
| 293 | """Test edge case with symlinks (if supported).""" |
| 294 | with tempfile.TemporaryDirectory() as temp_dir: |
| 295 | temp_path = Path(temp_dir) |
| 296 | test_dir = temp_path / "test_files" |
| 297 | cache_dir = temp_path / ".cache" |
| 298 | cache_dir.mkdir(exist_ok=True) |
| 299 | |
| 300 | # Create original files |
| 301 | original = test_dir / "original.txt" |
| 302 | original.parent.mkdir(parents=True, exist_ok=True) |
| 303 | original.write_text("Original content") |
| 304 | |
| 305 | # Try to create symlink |
| 306 | symlink = test_dir / "symlink.txt" |
| 307 | try: |
| 308 | symlink.symlink_to(original) |
| 309 | except (OSError, NotImplementedError): |
| 310 | pytest.skip("Symlinks not supported on this platform") |
| 311 | |
| 312 | include = ["**/*.txt"] |
| 313 | root = str(test_dir) |
| 314 | |
| 315 | # Test with TwoLayerFingerprintCache |
| 316 | two_layer = TwoLayerFingerprintCache(cache_dir, "symlink_two_layer") |
| 317 | two_layer.check_needs_update(include=include, root=root) |
| 318 | two_layer.mark_success() |
| 319 | |
| 320 | # Test with HashFingerprintCache |
| 321 | hash_cache = HashFingerprintCache(cache_dir, "symlink_hash") |
| 322 | hash_cache.check_needs_update(include=include, root=root) |
| 323 | hash_cache.mark_success() |
| 324 | |
| 325 | |
| 326 | def test_edge_case_unicode_filenames() -> None: |
nothing calls this directly
no test coverage detected