Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

- Added test_s3.py file which tests the S3Storage library using moto #100

Closed
wants to merge 2 commits into from

Conversation

rogaha
Copy link
Contributor

@rogaha rogaha commented Oct 13, 2013

  • Removed the test/s3.py file

  • Created a patched version of get_size() method on test_s3.py file to work with moto

    ** The methods stream_write and stream_read are not supported by moto yet

 * The methods stream_write and stream_read are not supported by moto yet
 * The s3_access_key and s3_secret_key must be lower case in order to perform the tests.
 - Removed the test/s3.py file
 - Added a little trick to the function get_size() from S3Storage() class
@@ -225,4 +225,7 @@ def get_size(self, path):
key = self._s3_bucket.lookup(path)
if not key:
raise OSError('No such key: \'{0}\''.format(path))
else:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will change the s3 code for the whole app, not just the test. This cannot be merged.

What about monkey patching the method get_size from the test code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I got it! Good idea! :)

@rogaha
Copy link
Contributor Author

rogaha commented Oct 13, 2013

@samalba,

There are some efforts towards the stream_write and stream_read support from the moto contributors.

getmoto/moto#51

Maybe we will be able to test it in a near future.

- Added to the load() method from storage a custom config_data support
- Added method check_env_variables() which checks if the environment variables exist in order to avoid error during the s3_storage tests
- Created a patched version of get_size() method on test_s3.py file
- Removed the patch from the S3Storage() class
- Added the moto library to the requirements file
- Added missing decorator above test_errors() method
@samalba
Copy link
Contributor

samalba commented Oct 26, 2013

Since moto does not allow testing stream functions, let's close this for now. @mzdaniel will submit a version not depending on moto.

@samalba samalba closed this Oct 26, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants