fix atmos tests and azure blobs
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/c45fa041 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/c45fa041 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/c45fa041 Branch: refs/heads/trunk Commit: c45fa041a44567e1f811e6bf618c0e7d8206b677 Parents: 80d7cb0 Author: Anthony Shaw <anthonys...@apache.org> Authored: Wed Apr 12 11:40:29 2017 +1000 Committer: Anthony Shaw <anthonys...@apache.org> Committed: Wed Apr 12 11:40:29 2017 +1000 ---------------------------------------------------------------------- libcloud/test/storage/test_atmos.py | 12 +++++++----- libcloud/test/storage/test_azure_blobs.py | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/c45fa041/libcloud/test/storage/test_atmos.py ---------------------------------------------------------------------- diff --git a/libcloud/test/storage/test_atmos.py b/libcloud/test/storage/test_atmos.py index 01f47f5..b6d9eb6 100644 --- a/libcloud/test/storage/test_atmos.py +++ b/libcloud/test/storage/test_atmos.py @@ -33,7 +33,7 @@ from libcloud.storage.types import ContainerAlreadyExistsError, \ from libcloud.storage.drivers.atmos import AtmosConnection, AtmosDriver from libcloud.storage.drivers.dummy import DummyIterator -from libcloud.test import MockHttp, generate_random_data +from libcloud.test import MockHttp, generate_random_data, make_response from libcloud.test.file_fixtures import StorageFileFixtures @@ -187,6 +187,7 @@ class AtmosTests(unittest.TestCase): self.fail('Exception was not thrown') def test_delete_object_success(self): + AtmosMockHttp.type = 'DELETE' container = Container(name='foo_bar_container', extra={}, driver=self.driver) obj = Object(name='foo_bar_object', size=1000, hash=None, extra={}, @@ -196,6 +197,7 @@ class AtmosTests(unittest.TestCase): self.assertTrue(status) def test_delete_object_escaped_success(self): + AtmosMockHttp.type = 'DELETE' container = Container(name='foo & bar_container', extra={}, driver=self.driver) obj = Object(name='foo & bar_object', size=1000, hash=None, extra={}, @@ -291,7 +293,7 @@ class AtmosTests(unittest.TestCase): def upload_file(self, object_name=None, content_type=None, request_path=None, request_method=None, headers=None, file_path=None, stream=None): - return {'response': MockResponse(200, headers={'etag': '0cc175b9c0f1b6a831c399e269772661'}), + return {'response': make_response(200, headers={'etag': '0cc175b9c0f1b6a831c399e269772661'}), 'bytes_transferred': 1000, 'data_hash': '0cc175b9c0f1b6a831c399e269772661'} @@ -633,11 +635,11 @@ class AtmosMockHttp(MockHttp, unittest.TestCase): return (httplib.NOT_FOUND, body, {}, httplib.responses[httplib.NOT_FOUND]) - def _rest_namespace_foo_bar_container_foo_bar_object(self, method, url, - body, headers): + def _rest_namespace_foo_bar_container_foo_bar_object_DELETE(self, method, url, + body, headers): return (httplib.OK, '', {}, httplib.responses[httplib.OK]) - def _rest_namespace_foo_20_26_20bar_container_foo_20_26_20bar_object( + def _rest_namespace_foo_20_26_20bar_container_foo_20_26_20bar_object_DELETE( self, method, url, body, headers): return (httplib.OK, '', {}, httplib.responses[httplib.OK]) http://git-wip-us.apache.org/repos/asf/libcloud/blob/c45fa041/libcloud/test/storage/test_azure_blobs.py ---------------------------------------------------------------------- diff --git a/libcloud/test/storage/test_azure_blobs.py b/libcloud/test/storage/test_azure_blobs.py index 156bae2..7fb770f 100644 --- a/libcloud/test/storage/test_azure_blobs.py +++ b/libcloud/test/storage/test_azure_blobs.py @@ -178,7 +178,7 @@ class AzureBlobsMockHttp(MockHttp): headers = {'content-type': 'application/zip', 'etag': '"e31208wqsdoj329jd"', 'x-amz-meta-rabbits': 'monkeys', - 'content-length': 12345, + 'content-length': '12345', 'last-modified': 'Thu, 13 Sep 2012 07:13:22 GMT' }