3

I'm trying to mock a s3 connection using moto. My class function looks something like this

def do_something(self):
  conn = boto3.client('s3')
  objects_dict = client.list_objects(Bucket='some-bucket', Prefix='test')
  do something with objects_dict

My test function looks like this

def mock_s3():
  mock = mock_s3()
  mock.start()

  path = Path('s3://some-bucket/test')
  path.do_something()

  mock.stop()

But I keep getting the following error botocore.errorfactory.NoSuchBucket: An error occurred (NoSuchBucket) when calling the ListObjects operation: The specified bucket does not exist

Oliver Robie
  • 818
  • 2
  • 11
  • 30

1 Answers1

0

I am also dealing with this issue. It is reported here: https://github.com/spulec/moto/issues/4913. Updating to moto 3.0.7 has been working most of the time, but not in all cases. I'm still trying to get to the bottom of it.