Skip to content

Commit

Permalink
Add an integration test for the prefix feature
Browse files Browse the repository at this point in the history
  • Loading branch information
exarkun committed Aug 24, 2017
1 parent aa9f164 commit 8128bf5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions txaws/testing/s3_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,21 @@ def test_objects(self):
"Expected to not find deleted objects in listing {}".format(objects),
)

@inlineCallbacks
def test_get_bucket_prefix(self):
"""
A subset of S3 objects in a bucket can be retrieved by specifying a value
for the ``prefix`` argument to ``get_bucket``.
"""
bucket_name = str(uuid4())
client = get_client(self)
yield client.create_bucket(bucket_name)
yield client.put_object(bucket_name, b"a", b"foo")
yield client.put_object(bucket_name, b"b", b"bar")

objects = yield client.get_bucket(bucket_name, prefix=b"a")
self.assertEqual([b"a"], list(obj.key for obj in objects.contents))

def test_get_bucket_location_empty(self):
"""
When called for a bucket with no explicit location,
Expand Down

0 comments on commit 8128bf5

Please sign in to comment.