File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ class HTTPSource:
1212 def __init__ (self , url : str ):
1313 self .url = url
1414 self .session = None
15+ self ._data_received = False
1516
1617 async def __aenter__ (self ):
1718 self .session = aiohttp .ClientSession ()
@@ -29,9 +30,12 @@ async def receive(self):
2930 async with self .session .get (self .url ) as response :
3031 if response .status == 200 :
3132 data = await response .json ()
32- return {'data' : data , 'metadata' : {'url' : self .url , 'status' : response .status }}
33+ return [ {'data' : data , 'metadata' : {'url' : self .url , 'status' : response .status }}]
3334 else :
34- return {'error' : f"HTTP { response .status } " , 'metadata' : {'url' : self .url , 'status' : response .status }}
35+ return [{'error' : f"HTTP { response .status } " , 'metadata' : {'url' : self .url , 'status' : response .status }}]
36+
37+ # Return an empty list if no data was received
38+ return []
3539
3640# Patch the engine to use our test HTTPSource
3741@pytest .fixture (autouse = True )
You can’t perform that action at this time.
0 commit comments