Skip to content

Commit 578e7e8

Browse files
Copilotpamelafox
andcommitted
Bump azure-storage-blob from 12.22.0 to 12.27.0 and update test mocks
Co-authored-by: pamelafox <[email protected]>
1 parent c349e3e commit 578e7e8

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

app/backend/requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ azure-ai-documentintelligence==1.0.0b4
88
azure-cognitiveservices-speech
99
azure-cosmos
1010
azure-search-documents==11.7.0b1
11-
azure-storage-blob
11+
azure-storage-blob==12.27.0
1212
azure-storage-file-datalake
1313
uvicorn
1414
aiohttp

app/backend/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ azure-monitor-opentelemetry-exporter==1.0.0b44
5858
# via azure-monitor-opentelemetry
5959
azure-search-documents==11.7.0b1
6060
# via -r requirements.in
61-
azure-storage-blob==12.22.0
61+
azure-storage-blob==12.27.0
6262
# via
6363
# -r requirements.in
6464
# azure-storage-file-datalake

tests/mocks.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,29 @@ async def readinto(self, buffer: BytesIO):
7575
buffer.write(b"test")
7676

7777

78+
class MockContentReader:
79+
"""Mock content reader for aiohttp.ClientResponse"""
80+
def __init__(self, body_bytes):
81+
self._body = body_bytes
82+
self._offset = 0
83+
self._exception = None
84+
85+
async def read(self, n=-1):
86+
if n == -1:
87+
result = self._body[self._offset:]
88+
self._offset = len(self._body)
89+
else:
90+
result = self._body[self._offset:self._offset + n]
91+
self._offset += len(result)
92+
return result
93+
94+
def exception(self):
95+
return self._exception
96+
97+
def set_exception(self, exc):
98+
self._exception = exc
99+
100+
78101
class MockAiohttpClientResponse404(aiohttp.ClientResponse):
79102
def __init__(self, url, body_bytes, headers=None):
80103
self._body = body_bytes
@@ -83,6 +106,8 @@ def __init__(self, url, body_bytes, headers=None):
83106
self.status = 404
84107
self.reason = "Not Found"
85108
self._url = url
109+
self._loop = None
110+
self.content = MockContentReader(body_bytes)
86111

87112

88113
class MockAiohttpClientResponse(aiohttp.ClientResponse):
@@ -93,6 +118,8 @@ def __init__(self, url, body_bytes, headers=None):
93118
self.status = 200
94119
self.reason = "OK"
95120
self._url = url
121+
self._loop = None
122+
self.content = MockContentReader(body_bytes)
96123

97124

98125
class MockTransport(AsyncHttpTransport):

0 commit comments

Comments
 (0)