@@ -98,6 +98,23 @@ def servicex_status_negative(mocker):
98
98
)
99
99
100
100
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
+
101
118
@pytest .fixture
102
119
def good_submit (mocker ):
103
120
client = mocker .MagicMock ()
@@ -191,7 +208,6 @@ async def test_status_no_auth(servicex_status_request):
191
208
192
209
@pytest .mark .asyncio
193
210
async def test_status_fatal_status (servicex_status_fatal ):
194
-
195
211
sa = ServiceXAdaptor ("http://localhost:500/sx" )
196
212
async with aiohttp .ClientSession () as client :
197
213
with pytest .raises (ServiceXFatalTransformException ) as e :
@@ -202,7 +218,6 @@ async def test_status_fatal_status(servicex_status_fatal):
202
218
203
219
@pytest .mark .asyncio
204
220
async def test_status_negative_status (servicex_status_negative ):
205
-
206
221
sa = ServiceXAdaptor ("http://localhost:500/sx" )
207
222
async with aiohttp .ClientSession () as client :
208
223
with pytest .raises (ServiceXFatalTransformException ) as e :
@@ -211,6 +226,16 @@ async def test_status_negative_status(servicex_status_negative):
211
226
assert "negative" in str (e .value )
212
227
213
228
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
+
214
239
@pytest .mark .asyncio
215
240
async def test_status_with_auth (mocker ):
216
241
client = mocker .MagicMock ()
@@ -243,7 +268,6 @@ async def test_status_with_auth(mocker):
243
268
244
269
@pytest .mark .asyncio
245
270
async def test_status_unknown_request (servicex_status_unknown ):
246
-
247
271
sa = ServiceXAdaptor ("http://localhost:5000/sx" )
248
272
with pytest .raises (ServiceXUnknownRequestID ) as e :
249
273
async with aiohttp .ClientSession () as client :
0 commit comments