diff options
author | Paul <paultax@gmail.com> | 2013-05-02 20:58:13 +0200 |
---|---|---|
committer | Paul <paultax@gmail.com> | 2013-05-02 20:58:13 +0200 |
commit | f15376bb4cf91c8aee6a06fdc0d1e277969e8211 (patch) | |
tree | 2b14852213f30fc981eedfb789e9c56a6351e109 | |
parent | ed39394b8ff1e1a01170d6b1e0e3a1ea87a94c69 (diff) | |
download | python-requests-aws-f15376bb4cf91c8aee6a06fdc0d1e277969e8211.tar.gz |
Fix issue#4 fix for encoded paths
Thanks @jamshid for reporting this
Bumping to version 0.1.3
-rw-r--r-- | awsauth.py | 2 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | test.py | 14 |
3 files changed, 16 insertions, 2 deletions
@@ -78,7 +78,7 @@ class S3Auth(AuthBase): buf += '/%s' % bucket # add the objectkey. even if it doesn't exist, add the slash - buf += '/%s' % urllib.unquote(objectkey) + buf += '/%s' % objectkey params_found = False @@ -15,7 +15,7 @@ if sys.argv[-1] == 'publish': setup( name='requests-aws', - version='0.1.2', + version='0.1.3', author='Paul Tax', author_email='paultax@gmail.com', include_package_data=True, @@ -42,5 +42,19 @@ class TestAWS(unittest.TestCase): r = requests.delete(url, auth=self.auth) self.assertEqual(r.status_code, 204) + def test_put_get_delete_filname_encoded(self): + testdata = 'Sam is sweet' + filename = 'my%20file.txt' + url = 'http://'+ TEST_BUCKET + '.s3.amazonaws.com/%s'%(filename) + r = requests.put(url, data=testdata, auth=self.auth) + self.assertEqual(r.status_code, 200) + # Downloading a file + r = requests.get(url, auth=self.auth) + self.assertEqual(r.status_code, 200) + self.assertEqual(r.content, testdata) + # Removing a file + r = requests.delete(url, auth=self.auth) + self.assertEqual(r.status_code, 204) + if __name__ == '__main__': unittest.main() |