@@ -77,11 +77,13 @@ def test_download_status_values(self):
7777
7878class TestLocalFileState :
7979 @pytest .mark .asyncio
80- async def test_update_state_creates_record (self , test_db_path ):
80+ async def test_update_state_creates_record (self , test_db_path , tmp_path ):
8181 client = PySUS (db_path = test_db_path )
8282
83+ local = pathlib .Path (tmp_path / "test.dbc" )
84+
8385 await client ._update_state (
84- local_path = pathlib . Path ( "/tmp/test.dbc" ) ,
86+ local_path = local ,
8587 remote_path = "/remote/test.dbc" ,
8688 client_name = "ftp" ,
8789 status = DownloadStatus .COMPLETED ,
@@ -93,9 +95,7 @@ async def test_update_state_creates_record(self, test_db_path):
9395
9496 with client .Session () as session :
9597 record = (
96- session .query (LocalFileState )
97- .filter_by (path = "/tmp/test.dbc" )
98- .first ()
98+ session .query (LocalFileState ).filter_by (path = str (local )).first ()
9999 )
100100 assert record is not None
101101 assert record .remote_path == "/remote/test.dbc"
@@ -109,34 +109,36 @@ async def test_update_state_creates_record(self, test_db_path):
109109 await client .__aexit__ (None , None , None )
110110
111111 @pytest .mark .asyncio
112- async def test_delete_record_removes_entry (self , test_db_path ):
112+ async def test_delete_record_removes_entry (self , test_db_path , tmp_path ):
113113 client = PySUS (db_path = test_db_path )
114114
115+ local = pathlib .Path (tmp_path / "test.dbc" )
116+
115117 await client ._update_state (
116- local_path = pathlib . Path ( "/tmp/test.dbc" ) ,
118+ local_path = local ,
117119 remote_path = "/remote/test.dbc" ,
118120 client_name = "ftp" ,
119121 status = DownloadStatus .COMPLETED ,
120122 )
121123
122- await client ._delete_record ("/tmp/test.dbc" )
124+ await client ._delete_record (str ( local ) )
123125
124126 with client .Session () as session :
125127 record = (
126- session .query (LocalFileState )
127- .filter_by (path = "/tmp/test.dbc" )
128- .first ()
128+ session .query (LocalFileState ).filter_by (path = str (local )).first ()
129129 )
130130 assert record is None
131131
132132 await client .__aexit__ (None , None , None )
133133
134134 @pytest .mark .asyncio
135- async def test_get_local_file_finds_existing (self , test_db_path ):
135+ async def test_get_local_file_finds_existing (self , test_db_path , tmp_path ):
136136 client = PySUS (db_path = test_db_path )
137137
138+ local = pathlib .Path (tmp_path / "test.dbc" )
139+
138140 await client ._update_state (
139- local_path = pathlib . Path ( "/tmp/test.dbc" ) ,
141+ local_path = local ,
140142 remote_path = "/remote/test.dbc" ,
141143 client_name = "ftp" ,
142144 status = DownloadStatus .COMPLETED ,
@@ -158,17 +160,20 @@ async def test_get_local_file_finds_existing(self, test_db_path):
158160
159161class TestGetCompletedRemotePaths :
160162 @pytest .mark .asyncio
161- async def test_get_completed_remote_paths (self , test_db_path ):
163+ async def test_get_completed_remote_paths (self , test_db_path , tmp_path ):
162164 client = PySUS (db_path = test_db_path )
163165
166+ local1 = pathlib .Path (tmp_path / "test1.dbc" )
167+ local2 = pathlib .Path (tmp_path / "test2.dbc" )
168+
164169 await client ._update_state (
165- local_path = pathlib . Path ( "/tmp/test1.dbc" ) ,
170+ local_path = local1 ,
166171 remote_path = "/remote/test1.dbc" ,
167172 client_name = "ftp" ,
168173 status = DownloadStatus .COMPLETED ,
169174 )
170175 await client ._update_state (
171- local_path = pathlib . Path ( "/tmp/test2.dbc" ) ,
176+ local_path = local2 ,
172177 remote_path = "/remote/test2.dbc" ,
173178 client_name = "ftp" ,
174179 status = DownloadStatus .PENDING ,
0 commit comments