You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2011/04/10 21:14:41 UTC
svn commit: r1090869 - in /incubator/libcloud/trunk/test: __init__.py
storage/test_cloudfiles.py
Author: tomaz
Date: Sun Apr 10 19:14:40 2011
New Revision: 1090869
URL: http://svn.apache.org/viewvc?rev=1090869&view=rev
Log:
Add StorageMockHttp class and make CloudFiles mock class use it.
Modified:
incubator/libcloud/trunk/test/__init__.py
incubator/libcloud/trunk/test/storage/test_cloudfiles.py
Modified: incubator/libcloud/trunk/test/__init__.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/__init__.py?rev=1090869&r1=1090868&r2=1090869&view=diff
==============================================================================
--- incubator/libcloud/trunk/test/__init__.py (original)
+++ incubator/libcloud/trunk/test/__init__.py Sun Apr 10 19:14:40 2011
@@ -153,6 +153,20 @@ class MockHttp(BaseMockHttpObject):
return (httplib.FORBIDDEN, 'Oh Noes!', {'X-Foo': 'fail'},
httplib.responses[httplib.FORBIDDEN])
+class StorageMockHttp(MockHttp):
+ def putrequest(self, method, action):
+ pass
+
+ def putheader(self, key, value):
+ pass
+
+ def endheaders(self):
+ pass
+
+ def send(self, data):
+ pass
+
+
class MockRawResponse(BaseMockHttpObject):
"""
Mock RawResponse object suitable for testing.
Modified: incubator/libcloud/trunk/test/storage/test_cloudfiles.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/storage/test_cloudfiles.py?rev=1090869&r1=1090868&r2=1090869&view=diff
==============================================================================
--- incubator/libcloud/trunk/test/storage/test_cloudfiles.py (original)
+++ incubator/libcloud/trunk/test/storage/test_cloudfiles.py Sun Apr 10 19:14:40 2011
@@ -32,7 +32,7 @@ from libcloud.storage.types import Objec
from libcloud.storage.drivers.cloudfiles import CloudFilesStorageDriver
from libcloud.storage.drivers.dummy import DummyIterator
-from test import MockHttp, MockRawResponse # pylint: disable-msg=E0611
+from test import StorageMockHttp, MockRawResponse # pylint: disable-msg=E0611
from test.file_fixtures import StorageFileFixtures # pylint: disable-msg=E0611
class CloudFilesTests(unittest.TestCase):
@@ -355,23 +355,11 @@ class CloudFilesTests(unittest.TestCase)
except OSError:
pass
-class CloudFilesMockHttp(MockHttp):
+class CloudFilesMockHttp(StorageMockHttp):
fixtures = StorageFileFixtures('cloudfiles')
base_headers = { 'content-type': 'application/json; charset=UTF-8'}
- def putrequest(self, method, action):
- pass
-
- def putheader(self, key, value):
- pass
-
- def endheaders(self):
- pass
-
- def send(self, data):
- pass
-
# fake auth token response
def _v1_0(self, method, url, body, headers):
headers = copy.deepcopy(self.base_headers)