Missing tests for core filesystem operations #20

Open
opened 2025-11-15 03:44:20 +00:00 by snegov · 0 comments
Owner

Missing tests for core filesystem operations

Priority: High
Component: tests/test_fs.py
Type: Testing

Description

The fs.py module has no tests despite containing complex logic for copying, rsyncing, and hardlinking files.

Missing Test Coverage

  • copy_file() - fast file copying
  • copy_direntry() - copying files/dirs/symlinks
  • update_direntry() - updating destination entries
  • rsync() - the core sync logic
  • hardlink_dir() - recursive hardlinking
  • nest_hardlink() - nested hardlink creation
  • scantree() - recursive directory traversal
  • rm_direntry() - recursive deletion

Risks

  • Complex logic with many edge cases (symlinks, permissions, ownership)
  • Platform-specific behavior (macOS vs Linux)
  • Error handling paths are untested
  • Refactoring is risky without tests

Proposed Solution

Add comprehensive test coverage in tests/test_fs.py for all functions, including:

  • Normal cases
  • Edge cases (empty dirs, symlinks, etc.)
  • Error conditions
  • Permission handling
  • Platform-specific behavior

Impact

High - Core functionality is untested, making bugs likely and refactoring risky.

# Missing tests for core filesystem operations **Priority:** High **Component:** tests/test_fs.py **Type:** Testing ## Description The `fs.py` module has no tests despite containing complex logic for copying, rsyncing, and hardlinking files. ## Missing Test Coverage - `copy_file()` - fast file copying - `copy_direntry()` - copying files/dirs/symlinks - `update_direntry()` - updating destination entries - `rsync()` - the core sync logic - `hardlink_dir()` - recursive hardlinking - `nest_hardlink()` - nested hardlink creation - `scantree()` - recursive directory traversal - `rm_direntry()` - recursive deletion ## Risks - Complex logic with many edge cases (symlinks, permissions, ownership) - Platform-specific behavior (macOS vs Linux) - Error handling paths are untested - Refactoring is risky without tests ## Proposed Solution Add comprehensive test coverage in `tests/test_fs.py` for all functions, including: - Normal cases - Edge cases (empty dirs, symlinks, etc.) - Error conditions - Permission handling - Platform-specific behavior ## Impact **High** - Core functionality is untested, making bugs likely and refactoring risky.
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: snegov/cura-te-ipsum#20
No description provided.