@@ -77,18 +77,18 @@ async def test_project_operations_sync_methods(
7777 test_project_name = f"test-project-{ os .urandom (4 ).hex ()} "
7878 with tempfile .TemporaryDirectory () as temp_dir :
7979 test_root = Path (temp_dir )
80- test_project_path = ( test_root / "test-project" ). as_posix ()
80+ test_project_path = test_root / "test-project"
8181
8282 # Make sure the test directory exists
83- os . makedirs ( test_project_path , exist_ok = True )
83+ test_project_path . mkdir ( parents = True , exist_ok = True )
8484
8585 try :
8686 # Test adding a project (using ConfigManager directly)
87- config_manager .add_project (test_project_name , test_project_path )
87+ config_manager .add_project (test_project_name , str ( test_project_path ) )
8888
8989 # Verify it was added
9090 assert test_project_name in project_service .projects
91- assert project_service .projects [test_project_name ] == test_project_path
91+ assert Path ( project_service .projects [test_project_name ]) == test_project_path
9292
9393 # Test setting as default
9494 original_default = project_service .default_project
@@ -173,24 +173,24 @@ async def test_add_project_async(project_service: ProjectService):
173173 test_project_name = f"test-async-project-{ os .urandom (4 ).hex ()} "
174174 with tempfile .TemporaryDirectory () as temp_dir :
175175 test_root = Path (temp_dir )
176- test_project_path = ( test_root / "test-async-project" ). as_posix ()
176+ test_project_path = test_root / "test-async-project"
177177
178178 # Make sure the test directory exists
179- os . makedirs ( test_project_path , exist_ok = True )
179+ test_project_path . mkdir ( parents = True , exist_ok = True )
180180
181181 try :
182182 # Test adding a project
183- await project_service .add_project (test_project_name , test_project_path )
183+ await project_service .add_project (test_project_name , str ( test_project_path ) )
184184
185185 # Verify it was added to config
186186 assert test_project_name in project_service .projects
187- assert project_service .projects [test_project_name ] == test_project_path
187+ assert Path ( project_service .projects [test_project_name ]) == test_project_path
188188
189189 # Verify it was added to the database
190190 project = await project_service .repository .get_by_name (test_project_name )
191191 assert project is not None
192192 assert project .name == test_project_name
193- assert project .path == test_project_path
193+ assert Path ( project .path ) == test_project_path
194194
195195 finally :
196196 # Clean up
@@ -569,34 +569,34 @@ async def test_move_project(project_service: ProjectService):
569569 test_project_name = f"test-move-project-{ os .urandom (4 ).hex ()} "
570570 with tempfile .TemporaryDirectory () as temp_dir :
571571 test_root = Path (temp_dir )
572- old_path = ( test_root / "old-location" ). as_posix ()
573- new_path = ( test_root / "new-location" ). as_posix ()
572+ old_path = test_root / "old-location"
573+ new_path = test_root / "new-location"
574574
575575 # Create old directory
576- os . makedirs ( old_path , exist_ok = True )
576+ old_path . mkdir ( parents = True , exist_ok = True )
577577
578578 try :
579579 # Add project with initial path
580- await project_service .add_project (test_project_name , old_path )
580+ await project_service .add_project (test_project_name , str ( old_path ) )
581581
582582 # Verify initial state
583583 assert test_project_name in project_service .projects
584- assert project_service .projects [test_project_name ] == old_path
584+ assert Path ( project_service .projects [test_project_name ]) == old_path
585585
586586 project = await project_service .repository .get_by_name (test_project_name )
587587 assert project is not None
588- assert project .path == old_path
588+ assert Path ( project .path ) == old_path
589589
590590 # Move project to new location
591- await project_service .move_project (test_project_name , new_path )
591+ await project_service .move_project (test_project_name , str ( new_path ) )
592592
593593 # Verify config was updated
594- assert project_service .projects [test_project_name ] == new_path
594+ assert Path ( project_service .projects [test_project_name ]) == new_path
595595
596596 # Verify database was updated
597597 updated_project = await project_service .repository .get_by_name (test_project_name )
598598 assert updated_project is not None
599- assert updated_project .path == new_path
599+ assert Path ( updated_project .path ) == new_path
600600
601601 # Verify new directory was created
602602 assert os .path .exists (new_path )
@@ -624,17 +624,17 @@ async def test_move_project_db_mismatch(project_service: ProjectService):
624624 test_project_name = f"test-move-mismatch-{ os .urandom (4 ).hex ()} "
625625 with tempfile .TemporaryDirectory () as temp_dir :
626626 test_root = Path (temp_dir )
627- old_path = ( test_root / "old-location" ). as_posix ()
628- new_path = ( test_root / "new-location" ). as_posix ()
627+ old_path = test_root / "old-location"
628+ new_path = test_root / "new-location"
629629
630630 # Create directories
631- os . makedirs ( old_path , exist_ok = True )
631+ old_path . mkdir ( parents = True , exist_ok = True )
632632
633633 config_manager = project_service .config_manager
634634
635635 try :
636636 # Add project to config only (not to database)
637- config_manager .add_project (test_project_name , old_path )
637+ config_manager .add_project (test_project_name , str ( old_path ) )
638638
639639 # Verify it's in config but not in database
640640 assert test_project_name in project_service .projects
@@ -643,10 +643,10 @@ async def test_move_project_db_mismatch(project_service: ProjectService):
643643
644644 # Try to move project - should fail and restore config
645645 with pytest .raises (ValueError , match = "not found in database" ):
646- await project_service .move_project (test_project_name , new_path )
646+ await project_service .move_project (test_project_name , str ( new_path ) )
647647
648648 # Verify config was restored to original path
649- assert project_service .projects [test_project_name ] == old_path
649+ assert Path ( project_service .projects [test_project_name ]) == old_path
650650
651651 finally :
652652 # Clean up
0 commit comments