@@ -98,6 +98,23 @@ def servicex_status_negative(mocker):
9898 )
9999
100100
101+ @pytest .fixture
102+ def servicex_no_files (mocker ):
103+ "Returns a result when there are no files in the dataset"
104+ result = {
105+ "files-processed" : 0 ,
106+ "files-remaining" : None ,
107+ "files-skipped" : 0 ,
108+ "request-id" : "24e59fa2-e1d7-4831-8c7e-82b2efc7c658" ,
109+ "stats" : None ,
110+ "status" : "Complete" ,
111+ }
112+ mocker .patch (
113+ "aiohttp.ClientSession.get" ,
114+ return_value = ClientSessionMocker (dumps (result ), 200 ),
115+ )
116+
117+
101118@pytest .fixture
102119def good_submit (mocker ):
103120 client = mocker .MagicMock ()
@@ -191,7 +208,6 @@ async def test_status_no_auth(servicex_status_request):
191208
192209@pytest .mark .asyncio
193210async def test_status_fatal_status (servicex_status_fatal ):
194-
195211 sa = ServiceXAdaptor ("http://localhost:500/sx" )
196212 async with aiohttp .ClientSession () as client :
197213 with pytest .raises (ServiceXFatalTransformException ) as e :
@@ -202,7 +218,6 @@ async def test_status_fatal_status(servicex_status_fatal):
202218
203219@pytest .mark .asyncio
204220async def test_status_negative_status (servicex_status_negative ):
205-
206221 sa = ServiceXAdaptor ("http://localhost:500/sx" )
207222 async with aiohttp .ClientSession () as client :
208223 with pytest .raises (ServiceXFatalTransformException ) as e :
@@ -211,6 +226,16 @@ async def test_status_negative_status(servicex_status_negative):
211226 assert "negative" in str (e .value )
212227
213228
229+ @pytest .mark .asyncio
230+ async def test_status_empty (servicex_no_files ):
231+ sa = ServiceXAdaptor ("http://localhost:500/sx" )
232+ async with aiohttp .ClientSession () as client :
233+ with pytest .raises (ServiceXFatalTransformException ) as e :
234+ await sa .get_transform_status (client , "123-123-123-444" )
235+
236+ assert "empty" in str (e .value )
237+
238+
214239@pytest .mark .asyncio
215240async def test_status_with_auth (mocker ):
216241 client = mocker .MagicMock ()
@@ -243,7 +268,6 @@ async def test_status_with_auth(mocker):
243268
244269@pytest .mark .asyncio
245270async def test_status_unknown_request (servicex_status_unknown ):
246-
247271 sa = ServiceXAdaptor ("http://localhost:5000/sx" )
248272 with pytest .raises (ServiceXUnknownRequestID ) as e :
249273 async with aiohttp .ClientSession () as client :
0 commit comments