1010from synapseclient import Synapse
1111from synapseclient .models import Project
1212
13- _TEST_PROJECT = Project (id = "test" , name = "test" )
14-
1513
1614def _write_manifest (rows : list [dict ], tmp_path : Path ) -> Path :
1715 """Write a minimal CSV manifest to a unique path under *tmp_path*."""
@@ -38,23 +36,25 @@ def init_syn(self, syn: Synapse) -> None:
3836 async def test_missing_path_column_raises (self , tmp_path : Path ) -> None :
3937 """A manifest without a 'path' column raises ValueError immediately."""
4038 manifest_path = _write_manifest ([{"parentId" : "syn123" , "name" : "x" }], tmp_path )
39+ project = Project (id = "test" , name = "test" )
4140
4241 with pytest .raises (ValueError , match = "'path'" ):
43- await _TEST_PROJECT .sync_to_synapse_async (
42+ await project .sync_to_synapse_async (
4443 manifest_path = str (manifest_path ), synapse_client = self .syn
4544 )
4645
47- async def test_missing_parentid_column_raises (self , tmp_path : Path ) -> None :
46+ async def test_missing_parent_id_column_raises (self , tmp_path : Path ) -> None :
4847 """A manifest without a 'parentId' column raises ValueError immediately."""
4948 local_file = tmp_path / "f.txt"
5049 local_file .write_text ("x" )
5150
5251 manifest_path = _write_manifest (
5352 [{"path" : str (local_file ), "name" : "f.txt" }], tmp_path
5453 )
54+ project = Project (id = "test" , name = "test" )
5555
5656 with pytest .raises (ValueError , match = "'parentId'" ):
57- await _TEST_PROJECT .sync_to_synapse_async (
57+ await project .sync_to_synapse_async (
5858 manifest_path = str (manifest_path ), synapse_client = self .syn
5959 )
6060
@@ -71,11 +71,12 @@ async def test_all_rows_have_errors_no_crash(self, tmp_path: Path) -> None:
7171 ],
7272 tmp_path ,
7373 )
74+ project = Project (id = "test" , name = "test" )
7475
7576 with patch (
7677 "synapseclient.models.mixins.storable_container.upload_sync_files"
7778 ) as mock_upload :
78- result = await _TEST_PROJECT .sync_to_synapse_async (
79+ result = await project .sync_to_synapse_async (
7980 manifest_path = str (manifest_path ), synapse_client = self .syn
8081 )
8182 mock_upload .assert_not_called ()
0 commit comments