From c349e3eeaeacc95dc7cd23c032504cbfb85cf215 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Nov 2025 19:23:22 +0000 Subject: [PATCH 1/2] Initial plan From 578e7e87b7287d845925c36d2c48f3b73b1f6e43 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Nov 2025 19:37:05 +0000 Subject: [PATCH 2/2] Bump azure-storage-blob from 12.22.0 to 12.27.0 and update test mocks Co-authored-by: pamelafox <297042+pamelafox@users.noreply.github.com> --- app/backend/requirements.in | 2 +- app/backend/requirements.txt | 2 +- tests/mocks.py | 27 +++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/app/backend/requirements.in b/app/backend/requirements.in index 756a857192..9ccaae4634 100644 --- a/app/backend/requirements.in +++ b/app/backend/requirements.in @@ -8,7 +8,7 @@ azure-ai-documentintelligence==1.0.0b4 azure-cognitiveservices-speech azure-cosmos azure-search-documents==11.7.0b1 -azure-storage-blob +azure-storage-blob==12.27.0 azure-storage-file-datalake uvicorn aiohttp diff --git a/app/backend/requirements.txt b/app/backend/requirements.txt index 5eab109d1f..450dc60c56 100644 --- a/app/backend/requirements.txt +++ b/app/backend/requirements.txt @@ -58,7 +58,7 @@ azure-monitor-opentelemetry-exporter==1.0.0b44 # via azure-monitor-opentelemetry azure-search-documents==11.7.0b1 # via -r requirements.in -azure-storage-blob==12.22.0 +azure-storage-blob==12.27.0 # via # -r requirements.in # azure-storage-file-datalake diff --git a/tests/mocks.py b/tests/mocks.py index 6c52ee90e5..68cb665885 100644 --- a/tests/mocks.py +++ b/tests/mocks.py @@ -75,6 +75,29 @@ async def readinto(self, buffer: BytesIO): buffer.write(b"test") +class MockContentReader: + """Mock content reader for aiohttp.ClientResponse""" + def __init__(self, body_bytes): + self._body = body_bytes + self._offset = 0 + self._exception = None + + async def read(self, n=-1): + if n == -1: + result = self._body[self._offset:] + self._offset = len(self._body) + else: + result = self._body[self._offset:self._offset + n] + self._offset += len(result) + return result + + def exception(self): + return self._exception + + def set_exception(self, exc): + self._exception = exc + + class MockAiohttpClientResponse404(aiohttp.ClientResponse): def __init__(self, url, body_bytes, headers=None): self._body = body_bytes @@ -83,6 +106,8 @@ def __init__(self, url, body_bytes, headers=None): self.status = 404 self.reason = "Not Found" self._url = url + self._loop = None + self.content = MockContentReader(body_bytes) class MockAiohttpClientResponse(aiohttp.ClientResponse): @@ -93,6 +118,8 @@ def __init__(self, url, body_bytes, headers=None): self.status = 200 self.reason = "OK" self._url = url + self._loop = None + self.content = MockContentReader(body_bytes) class MockTransport(AsyncHttpTransport):