MCPcopy Create free account
hub / github.com/vastsa/FileCodeBox / FakeS3Client

Class FakeS3Client

tests/test_issue_478_s3_file_exists.py:7–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5
6
7class FakeS3Client:
8 def __init__(self, list_response):
9 self.list_response = list_response
10 self.head_calls = 0
11
12 async def __aenter__(self):
13 return self
14
15 async def __aexit__(self, exc_type, exc, traceback):
16 return False
17
18 async def head_object(self, **kwargs):
19 self.head_calls += 1
20 raise RuntimeError("head not supported")
21
22 async def list_objects_v2(self, **kwargs):
23 return self.list_response
24
25
26class S3FileExistsTests(unittest.TestCase):

Calls

no outgoing calls