libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject svn commit: r919947 - in /incubator/libcloud/trunk/test: fixtures/voxel/ fixtures/voxel/unauthorized.xml test_voxel.py
Date Sun, 07 Mar 2010 07:40:14 GMT
Author: jerry
Date: Sun Mar  7 07:40:14 2010
New Revision: 919947

URL: http://svn.apache.org/viewvc?rev=919947&view=rev
Log:
Converted VoxelMockHttp to use FileFixtures

Added:
    incubator/libcloud/trunk/test/fixtures/voxel/
    incubator/libcloud/trunk/test/fixtures/voxel/unauthorized.xml
Modified:
    incubator/libcloud/trunk/test/test_voxel.py

Added: incubator/libcloud/trunk/test/fixtures/voxel/unauthorized.xml
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/fixtures/voxel/unauthorized.xml?rev=919947&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/fixtures/voxel/unauthorized.xml (added)
+++ incubator/libcloud/trunk/test/fixtures/voxel/unauthorized.xml Sun Mar  7 07:40:14 2010
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<rsp stat="fail">
+  <err code="1" msg="Invalid login or password"/>
+  <method>voxel.devices.list</method>
+  <parameters>
+    <param name="timestamp">2010-02-10T23:39:25.808107+0000</param>
+    <param name="key">authshouldfail</param>
+    <param name="api_sig">ae069bb835e998622caaddaeff8c98e0</param>
+  </parameters>
+  <string_to_sign>YOUR_SECRETtimestamp2010-02-10T23:39:25.808107+0000methodvoxel.devices.listkeyauthshouldfail</string_to_sign>
+</rsp>

Modified: incubator/libcloud/trunk/test/test_voxel.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/test_voxel.py?rev=919947&r1=919946&r2=919947&view=diff
==============================================================================
--- incubator/libcloud/trunk/test/test_voxel.py (original)
+++ incubator/libcloud/trunk/test/test_voxel.py Sun Mar  7 07:40:14 2010
@@ -22,6 +22,8 @@
 import httplib
 
 from test import MockHttp, multipleresponse, TestCaseMixin
+from test.file_fixtures import FileFixtures
+
 from secrets import VOXEL_KEY, VOXEL_SECRET
 from xml.etree import ElementTree as ET
 
@@ -44,10 +46,10 @@
 
 class VoxelMockHttp(MockHttp):
 
+    fixtures = FileFixtures('voxel')
+
     def _UNAUTHORIZED(self, method, url, body, headers):
-        body = """<?xml version="1.0"?>
-<rsp stat="fail"><err code="1" msg="Invalid login or password"/><method>voxel.devices.list</method><parameters><param
name="timestamp">2010-02-10T23:39:25.808107+0000</param><param name="key">authshouldfail</param><param
name="api_sig">ae069bb835e998622caaddaeff8c98e0</param></parameters><string_to_sign>YOUR_SECRETtimestamp2010-02-10T23:39:25.808107+0000methodvoxel.devices.listkeyauthshouldfail</string_to_sign></rsp>
-"""
+        body = self.fixtures.load('unauthorized.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
 if __name__ == '__main__':



Mime
View raw message