We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code demonstrates that the listing of keys is inconsistent with boto's implementation.
Here is the output:
real s3 [u'toplevel/x/key', u'toplevel/x/y/key', u'toplevel/x/y/z/key', u'toplevel/y.key1', u'toplevel/y.key2', u'toplevel/y.key3'] [u'toplevel/y.key1', u'toplevel/y.key2', u'toplevel/y.key3', u'toplevel/x/']
mocked s3 [u'toplevel/y.key1', u'toplevel/y.key2', u'toplevel/y.key3', u'toplevel/x'] [u'toplevel/y.key1', u'toplevel/y.key2', u'toplevel/y.key3', u'toplevel/x']
The test code:
import boto from boto.s3.key import Key from moto import mock_s3 BUCKET = 'dilshodtest1bucket' prefix = 'toplevel/' def main(): conn = boto.connect_s3() conn.create_bucket(BUCKET) bucket = conn.get_bucket(BUCKET) def store(name): k = Key(bucket, prefix + name) k.set_contents_from_string('somedata') names = ['x/key', 'y.key1', 'y.key2', 'y.key3', 'x/y/key', 'x/y/z/key'] for name in names: store(name) delimiter = None keys = [x.name for x in bucket.list(prefix, delimiter)] print keys delimiter = '/' keys = [x.name for x in bucket.list(prefix, delimiter)] print keys if __name__ == '__main__': print 'real s3' main() print 'mocked s3' mock = mock_s3() mock.start() main() mock.stop()
The text was updated successfully, but these errors were encountered:
be26daa
Clean up code for listing s3 keys. Fix #14.
4c8244b
Merge pull request #14 from spulec/master
0c3d7c4
Merge upstream
No branches or pull requests
The following code demonstrates that the listing of keys is inconsistent with boto's implementation.
Here is the output:
real s3
[u'toplevel/x/key', u'toplevel/x/y/key', u'toplevel/x/y/z/key', u'toplevel/y.key1', u'toplevel/y.key2', u'toplevel/y.key3']
[u'toplevel/y.key1', u'toplevel/y.key2', u'toplevel/y.key3', u'toplevel/x/']
mocked s3
[u'toplevel/y.key1', u'toplevel/y.key2', u'toplevel/y.key3', u'toplevel/x']
[u'toplevel/y.key1', u'toplevel/y.key2', u'toplevel/y.key3', u'toplevel/x']
The test code:
The text was updated successfully, but these errors were encountered: