From 7460a938dfd08d72117827e8f7ea8c51fcb32587 Mon Sep 17 00:00:00 2001 From: Drew Cain Date: Fri, 1 Aug 2025 22:02:53 -0500 Subject: [PATCH] fix: make case sensitivity test platform-aware - Add platform detection to handle case-insensitive file systems - Test now passes on macOS and Windows while maintaining Linux behavior - Fixes test failure on case-insensitive file systems --- tests/sync/test_character_conflicts.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/tests/sync/test_character_conflicts.py b/tests/sync/test_character_conflicts.py index 5b218247..dd7aea34 100644 --- a/tests/sync/test_character_conflicts.py +++ b/tests/sync/test_character_conflicts.py @@ -224,6 +224,8 @@ class TestSyncConflictHandling: entity_repository: EntityRepository, ): """Test conflict handling when case differences cause issues.""" + import platform + project_dir = project_config.home # Create directory structure that might cause case conflicts @@ -254,12 +256,22 @@ class TestSyncConflictHandling: # Verify entities were created entities = await entity_repository.find_all() - assert len(entities) >= 2 # Allow for potential other test files - - # Check that file paths are preserved correctly - file_paths = [entity.file_path for entity in entities] - assert "Finance/investment.md" in file_paths - assert "finance/investment.md" in file_paths + + # On case-insensitive file systems (macOS, Windows), only one entity will be created + # On case-sensitive file systems (Linux), two entities will be created + if platform.system() in ["Darwin", "Windows"]: + # Case-insensitive file systems + assert len(entities) >= 1 + # Only one of the paths will exist + file_paths = [entity.file_path for entity in entities] + assert any(path in ["Finance/investment.md", "finance/investment.md"] for path in file_paths) + else: + # Case-sensitive file systems (Linux) + assert len(entities) >= 2 + # Check that file paths are preserved correctly + file_paths = [entity.file_path for entity in entities] + assert "Finance/investment.md" in file_paths + assert "finance/investment.md" in file_paths async def test_move_conflict_resolution( self,