libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1442714 [2/2] - in /libcloud/branches/0.12.x: ./ libcloud/common/ libcloud/compute/drivers/ libcloud/data/ libcloud/dns/drivers/ libcloud/test/common/ libcloud/test/compute/ libcloud/test/compute/fixtures/hostvirtual/ libcloud/test/compute...
Date Tue, 05 Feb 2013 19:50:18 GMT
Modified: libcloud/branches/0.12.x/libcloud/test/compute/test_hostvirtual.py
URL: http://svn.apache.org/viewvc/libcloud/branches/0.12.x/libcloud/test/compute/test_hostvirtual.py?rev=1442714&r1=1442713&r2=1442714&view=diff
==============================================================================
--- libcloud/branches/0.12.x/libcloud/test/compute/test_hostvirtual.py (original)
+++ libcloud/branches/0.12.x/libcloud/test/compute/test_hostvirtual.py Tue Feb  5 19:50:18
2013
@@ -45,9 +45,9 @@ class HostVirtualTest(unittest.TestCase)
 
     def test_list_sizes(self):
         sizes = self.driver.list_sizes()
-        self.assertEqual(len(sizes), 10)
-        self.assertEqual(sizes[0].id, 'VR256')
-        self.assertEqual(sizes[4].id, 'VR1024')
+        self.assertEqual(len(sizes), 14)
+        self.assertEqual(sizes[0].id, '31')
+        self.assertEqual(sizes[4].id, '71')
         self.assertEqual(sizes[2].ram, '512MB')
         self.assertEqual(sizes[2].disk, '20GB')
         self.assertEqual(sizes[3].bandwidth, '600GB')
@@ -70,11 +70,18 @@ class HostVirtualTest(unittest.TestCase)
         node = self.driver.list_nodes()[0]
         self.assertTrue(self.driver.reboot_node(node))
 
-    def test_stop_node(self):
+    def test_ex_get_node(self):
+        node = self.driver.ex_get_node(node_id='62291')
+        self.assertEqual(node.id, '62291')
+        self.assertEqual(node.name, 'server1.vr-cluster.org')
+        self.assertEqual(node.state, NodeState.TERMINATED)
+        self.assertTrue('208.111.45.250' in node.public_ips)
+
+    def test_ex_stop_node(self):
         node = self.driver.list_nodes()[0]
         self.assertTrue(self.driver.ex_stop_node(node))
 
-    def test_start_node(self):
+    def test_ex_start_node(self):
         node = self.driver.list_nodes()[0]
         self.assertTrue(self.driver.ex_start_node(node))
 
@@ -82,6 +89,10 @@ class HostVirtualTest(unittest.TestCase)
         node = self.driver.list_nodes()[0]
         self.assertTrue(self.driver.destroy_node(node))
 
+    def test_ex_delete_node(self):
+        node = self.driver.list_nodes()[0]
+        self.assertTrue(self.driver.ex_delete_node(node))
+
     def test_create_node(self):
         auth = NodeAuthPassword('vr!@#hosted#@!')
         size = self.driver.list_sizes()[0]
@@ -95,6 +106,14 @@ class HostVirtualTest(unittest.TestCase)
         self.assertEqual('76070', node.id)
         self.assertEqual('test.com', node.name)
 
+    def test_ex_build_node(self):
+        node = self.driver.list_nodes()[0]
+        auth = NodeAuthPassword('vr!@#hosted#@!')
+        self.assertTrue(self.driver.ex_build_node(
+            node=node,
+            auth=auth
+        ))
+
     def test_create_node_in_location(self):
         auth = NodeAuthPassword('vr!@#hosted#@!')
         size = self.driver.list_sizes()[0]
@@ -118,6 +137,10 @@ class HostVirtualMockHttp(MockHttp):
         body = self.fixtures.load('list_nodes.json')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
+    def _vapi_cloud_server(self, method, url, body, headers):
+        body = self.fixtures.load('get_node.json')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
     def _vapi_cloud_sizes(self, method, url, body, headers):
         body = self.fixtures.load('list_sizes.json')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
@@ -150,6 +173,14 @@ class HostVirtualMockHttp(MockHttp):
         body = self.fixtures.load('create_node.json')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
+    def _vapi_cloud_server_build(self, method, url, body, headers):
+        body = self.fixtures.load('create_node.json')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _vapi_cloud_server_delete(self, method, url, body, headers):
+        body = self.fixtures.load('node_destroy.json')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
 if __name__ == '__main__':
     sys.exit(unittest.main())
 

Modified: libcloud/branches/0.12.x/libcloud/test/compute/test_softlayer.py
URL: http://svn.apache.org/viewvc/libcloud/branches/0.12.x/libcloud/test/compute/test_softlayer.py?rev=1442714&r1=1442713&r2=1442714&view=diff
==============================================================================
--- libcloud/branches/0.12.x/libcloud/test/compute/test_softlayer.py (original)
+++ libcloud/branches/0.12.x/libcloud/test/compute/test_softlayer.py Tue Feb  5 19:50:18 2013
@@ -18,37 +18,28 @@ import sys
 
 from xml.etree import ElementTree as ET
 
+from libcloud.common.types import InvalidCredsError
+
 from libcloud.utils.py3 import httplib
 from libcloud.utils.py3 import xmlrpclib
 from libcloud.utils.py3 import next
+from libcloud.utils.py3 import u
 
 from libcloud.compute.drivers.softlayer import SoftLayerNodeDriver as SoftLayer
+from libcloud.compute.drivers.softlayer import SoftLayerException
 from libcloud.compute.types import NodeState
 
 from libcloud.test import MockHttp               # pylint: disable-msg=E0611
-from libcloud.test.file_fixtures import ComputeFileFixtures # pylint: disable-msg=E0611
+from libcloud.test.file_fixtures import ComputeFileFixtures  # pylint: disable-msg=E0611
 from libcloud.test.secrets import SOFTLAYER_PARAMS
 
-class MockSoftLayerTransport(xmlrpclib.Transport):
-
-    def request(self, host, handler, request_body, verbose=0):
-        self.verbose = 0
-        method = ET.XML(request_body).find('methodName').text
-        mock = SoftLayerMockHttp(host, 80)
-        mock.request('POST', "%s/%s" % (handler, method))
-        resp = mock.getresponse()
-
-        if sys.version[0] == '2' and sys.version[2] == '7':
-            response = self.parse_response(resp)
-        else:
-            response = self.parse_response(resp.body)
-        return response
 
 class SoftLayerTests(unittest.TestCase):
 
     def setUp(self):
-        SoftLayer.connectionCls.proxyCls.transportCls = [
-            MockSoftLayerTransport, MockSoftLayerTransport]
+        SoftLayer.connectionCls.conn_classes = (
+            SoftLayerMockHttp, SoftLayerMockHttp)
+        SoftLayerMockHttp.type = None
         self.driver = SoftLayer(*SOFTLAYER_PARAMS)
 
     def test_list_nodes(self):
@@ -59,36 +50,142 @@ class SoftLayerTests(unittest.TestCase):
 
     def test_list_locations(self):
         locations = self.driver.list_locations()
-        seattle = next(l for l in locations if l.name == 'sea01')
-        self.assertEqual(seattle.country, 'US')
-        self.assertEqual(seattle.id, '18171')
+        dal = next(l for l in locations if l.id == 'dal05')
+        self.assertEqual(dal.country, 'US')
+        self.assertEqual(dal.id, 'dal05')
+        self.assertEqual(dal.name, 'Dallas 5')
 
     def test_list_images(self):
         images = self.driver.list_images()
         image = images[0]
-        self.assertEqual(image.id, '1684')
+        self.assertEqual(image.id, 'CENTOS_6_64')
 
     def test_list_sizes(self):
         sizes = self.driver.list_sizes()
-        self.assertEqual(len(sizes), 2)
-        size = [s for s in sizes if s.id == 'sl1']
+        self.assertEqual(len(sizes), 10)
+        size = [s for s in sizes if s.id == 'sl2_local_disk']
         self.assertEqual(len(size), 1)
 
+    def test_create_node(self):
+        self.driver.create_node(name="Test",
+                                location=self.driver.list_locations()[0],
+                                size=self.driver.list_sizes()[0],
+                                image=self.driver.list_images()[0])
+
+    def test_create_fail(self):
+        SoftLayerMockHttp.type = "SOFTLAYEREXCEPTION"
+        self.assertRaises(
+            SoftLayerException,
+            self.driver.create_node,
+            name="SOFTLAYEREXCEPTION",
+            location=self.driver.list_locations()[0],
+            size=self.driver.list_sizes()[0],
+            image=self.driver.list_images()[0])
+
+    def test_create_creds_error(self):
+        SoftLayerMockHttp.type = "INVALIDCREDSERROR"
+        self.assertRaises(
+            InvalidCredsError,
+            self.driver.create_node,
+            name="INVALIDCREDSERROR",
+            location=self.driver.list_locations()[0],
+            size=self.driver.list_sizes()[0],
+            image=self.driver.list_images()[0])
+
+    def test_create_node_no_location(self):
+        self.driver.create_node(name="Test",
+                                size=self.driver.list_sizes()[0],
+                                image=self.driver.list_images()[0])
+
+    def test_create_node_no_image(self):
+        self.driver.create_node(name="Test", size=self.driver.list_sizes()[0])
+
+    def test_create_node_san(self):
+        size = [s for s in self.driver.list_sizes() if 'san' in s.id][0]
+        self.driver.create_node(name="Test", size=size)
+
+    def test_create_node_domain_for_name(self):
+        size = [s for s in self.driver.list_sizes() if 'san' in s.id][0]
+        self.driver.create_node(name="libcloud.org")
+
+    def test_create_node_ex_options(self):
+        self.driver.create_node(name="Test",
+                                location=self.driver.list_locations()[0],
+                                size=self.driver.list_sizes()[0],
+                                image=self.driver.list_images()[0],
+                                ex_domain='libcloud.org',
+                                ex_cpus=2,
+                                ex_ram=2048,
+                                ex_disk=100,
+                                ex_bandwidth=10,
+                                ex_local_disk=False,
+                                ex_datacenter='Dal05',
+                                ex_os='UBUNTU_LATEST')
+
+    def test_reboot_node(self):
+        node = self.driver.list_nodes()[0]
+        self.driver.reboot_node(node)
+
+    def test_destroy_node(self):
+        node = self.driver.list_nodes()[0]
+        self.driver.destroy_node(node)
+
+
 class SoftLayerMockHttp(MockHttp):
     fixtures = ComputeFileFixtures('softlayer')
 
-    def _xmlrpc_v3__SoftLayer_Account_getVirtualGuests(
-        self, method, url, body, headers):
+    def _get_method_name(self, type, use_param, qs, path):
+        return "_xmlrpc"
+
+    def _xmlrpc(self, method, url, body, headers):
+        params, meth_name = xmlrpclib.loads(body)
+        url = url.replace("/", "_")
+        meth_name = "%s_%s" % (url, meth_name)
+        return getattr(self, meth_name)(method, url, body, headers)
+
+    def _xmlrpc_v3__SoftLayer_Virtual_Guest_getCreateObjectOptions(
+            self, method, url, body, headers):
+        body = self.fixtures.load(
+            'v3__SoftLayer_Virtual_Guest_getCreateObjectOptions.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
+    def _xmlrpc_v3__SoftLayer_Account_getVirtualGuests(
+            self, method, url, body, headers):
         body = self.fixtures.load('v3_SoftLayer_Account_getVirtualGuests.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
     def _xmlrpc_v3__SoftLayer_Location_Datacenter_getDatacenters(
-        self, method, url, body, headers):
-
+            self, method, url, body, headers):
         body = self.fixtures.load(
             'v3_SoftLayer_Location_Datacenter_getDatacenters.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
+    def _xmlrpc_v3__SoftLayer_Virtual_Guest_createObject(
+            self, method, url, body, headers):
+        fixture = {
+            None: 'v3__SoftLayer_Virtual_Guest_createObject.xml',
+            'INVALIDCREDSERROR': 'SoftLayer_Account.xml',
+            'SOFTLAYEREXCEPTION': 'fail.xml',
+        }[self.type]
+        body = self.fixtures.load(fixture)
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc_v3__SoftLayer_Virtual_Guest_getObject(
+            self, method, url, body, headers):
+        body = self.fixtures.load(
+            'v3__SoftLayer_Virtual_Guest_getObject.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc_v3__SoftLayer_Virtual_Guest_rebootSoft(
+            self, method, url, body, headers):
+        body = self.fixtures.load('empty.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc_v3__SoftLayer_Virtual_Guest_deleteObject(
+            self, method, url, body, headers):
+        body = self.fixtures.load('empty.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+
 if __name__ == '__main__':
     sys.exit(unittest.main())

Modified: libcloud/branches/0.12.x/libcloud/test/compute/test_vcl.py
URL: http://svn.apache.org/viewvc/libcloud/branches/0.12.x/libcloud/test/compute/test_vcl.py?rev=1442714&r1=1442713&r2=1442714&view=diff
==============================================================================
--- libcloud/branches/0.12.x/libcloud/test/compute/test_vcl.py (original)
+++ libcloud/branches/0.12.x/libcloud/test/compute/test_vcl.py Tue Feb  5 19:50:18 2013
@@ -29,31 +29,13 @@ from libcloud.test import MockHttp
 from libcloud.test.file_fixtures import ComputeFileFixtures
 from libcloud.test.secrets import VCL_PARAMS
 
-class MockVCLTransport(xmlrpclib.Transport):
-
-    def __init__(self, datetime, user, passwd, host):
-        self._use_datetime = datetime
-        self._connection = (None, None)
-        self._extra_headers = []
-        self._use_builtin_types = False
-
-    def request(self, host, handler, request_body, verbose=0):
-        self.verbose = 0
-        method = ET.XML(request_body).find('methodName').text
-        mock = VCLMockHttp(host, 80)
-        mock.request('POST', method)
-        resp = mock.getresponse()
-
-        if sys.version[0] == '2' and sys.version[2] == '7':
-            response = self.parse_response(resp)
-        else:
-            response = self.parse_response(resp.body)
-        return response
 
 class VCLTests(unittest.TestCase):
 
     def setUp(self):
-        VCL.connectionCls.proxyCls.transportCls = MockVCLTransport
+        VCL.connectionCls.conn_classes = (
+            VCLMockHttp, VCLMockHttp)
+        VCLMockHttp.type = None
         self.driver = VCL(*VCL_PARAMS)
 
     def test_list_nodes(self):
@@ -98,50 +80,48 @@ class VCLTests(unittest.TestCase):
             1334168100
         )
 
+
 class VCLMockHttp(MockHttp):
     fixtures = ComputeFileFixtures('vcl')
 
+    def _get_method_name(self, type, use_param, qs, path):
+        return "_xmlrpc"
+
+    def _xmlrpc(self, method, url, body, headers):
+        params, meth_name = xmlrpclib.loads(body)
+        if self.type:
+            meth_name = "%s_%s" % (meth_name, self.type)
+        return getattr(self, meth_name)(method, url, body, headers)
+
     def XMLRPCgetImages(self, method, url, body, headers):
         body = self.fixtures.load('XMLRPCgetImages.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def XMLRPCextendRequest(
-        self, method, url, body, headers):
-
+    def XMLRPCextendRequest(self, method, url, body, headers):
         body = self.fixtures.load('XMLRPCextendRequest.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def XMLRPCgetRequestIds(
-        self, method, url, body, headers):
-
+    def XMLRPCgetRequestIds(self, method, url, body, headers):
         body = self.fixtures.load(
             'XMLRPCgetRequestIds.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def XMLRPCgetRequestStatus(
-        self, method, url, body, headers):
-
+    def XMLRPCgetRequestStatus(self, method, url, body, headers):
         body = self.fixtures.load(
             'XMLRPCgetRequestStatus.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def XMLRPCendRequest(
-        self, method, url, body, headers):
-
+    def XMLRPCendRequest(self, method, url, body, headers):
         body = self.fixtures.load(
             'XMLRPCendRequest.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def XMLRPCaddRequest(
-        self, method, url, body, headers):
-
+    def XMLRPCaddRequest(self, method, url, body, headers):
         body = self.fixtures.load(
             'XMLRPCaddRequest.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def XMLRPCgetRequestConnectData(
-        self, method, url, body, headers):
-
+    def XMLRPCgetRequestConnectData(self, method, url, body, headers):
         body = self.fixtures.load(
             'XMLRPCgetRequestConnectData.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])

Modified: libcloud/branches/0.12.x/libcloud/test/dns/test_gandi.py
URL: http://svn.apache.org/viewvc/libcloud/branches/0.12.x/libcloud/test/dns/test_gandi.py?rev=1442714&r1=1442713&r2=1442714&view=diff
==============================================================================
--- libcloud/branches/0.12.x/libcloud/test/dns/test_gandi.py (original)
+++ libcloud/branches/0.12.x/libcloud/test/dns/test_gandi.py Tue Feb  5 19:50:18 2013
@@ -17,106 +17,21 @@ import sys
 import unittest
 
 from libcloud.utils.py3 import httplib
-from libcloud.utils.py3 import xmlrpclib
 from libcloud.dns.types import RecordType, ZoneDoesNotExistError
 from libcloud.dns.types import RecordDoesNotExistError
 from libcloud.dns.drivers.gandi import GandiDNSDriver
-from libcloud.test import MockHttp
 from libcloud.test.file_fixtures import DNSFileFixtures
 from libcloud.test.secrets import DNS_GANDI
-from libcloud.test.common.test_gandi import MockGandiTransport, BaseGandiTests
+from libcloud.test.common.test_gandi import BaseGandiMockHttp
 
-Fault = xmlrpclib.Fault
 
-class GandiMockHttp(MockHttp):
-    fixtures = DNSFileFixtures('gandi')
-
-    def _xmlrpc__domain_zone_create(self, method, url, body, headers):
-        body = self.fixtures.load('create_zone.xml')
-        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
-
-    def _xmlrpc__domain_zone_update(self, method, url, body, headers):
-        body = self.fixtures.load('get_zone.xml')
-        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+class GandiTests(unittest.TestCase):
 
-    def _xmlrpc__domain_zone_list(self, method, url, body, headers):
-        body = self.fixtures.load('list_zones.xml')
-        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
-
-    def _xmlrpc__domain_zone_record_list(self, method, url, body, headers):
-        body = self.fixtures.load('list_records.xml')
-        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
-
-    def _xmlrpc__domain_zone_record_add(self, method, url, body, headers):
-        body = self.fixtures.load('create_record.xml')
-        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
-
-    def _xmlrpc__domain_zone_delete(self, method, url, body, headers):
-        body = self.fixtures.load('delete_zone.xml')
-        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
-
-    def _xmlrpc__domain_zone_info(self, method, url, body, headers):
-        body = self.fixtures.load('get_zone.xml')
-        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
-
-    def _xmlrpc__domain_zone_record_delete(self, method, url, body, headers):
-        body = self.fixtures.load('delete_record.xml')
-        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
-
-    def _xmlrpc__domain_zone_record_update(self, method, url, body, headers):
-        body = self.fixtures.load('create_record.xml')
-        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
-
-    def _xmlrpc__domain_zone_version_new(self, method, url, body, headers):
-        body = self.fixtures.load('new_version.xml')
-        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
-
-    def _xmlrpc__domain_zone_version_set(self, method, url, body, headers):
-        body = self.fixtures.load('new_version.xml')
-        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
-
-    def _xmlrpc__domain_zone_record_list_ZONE_DOES_NOT_EXIST(self, method, url, body, headers):
-        raise Fault(581042, "Zone does not exist")
-
-    def _xmlrpc__domain_zone_info_ZONE_DOES_NOT_EXIST(self, method, url, body, headers):
-        raise Fault(581042, "Zone does not exist")
-
-    def _xmlrpc__domain_zone_list_ZONE_DOES_NOT_EXIST(self, method, url, body, headers):
-        raise Fault(581042, "Zone does not exist")
-
-    def _xmlrpc__domain_zone_delete_ZONE_DOES_NOT_EXIST(self, method, url, body, headers):
-        raise Fault(581042, "Zone does not exist")
-
-    def _xmlrpc__domain_zone_record_list_RECORD_DOES_NOT_EXIST(self, method, url, body, headers):
-        body = self.fixtures.load('list_records_empty.xml')
-        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
-
-    def _xmlrpc__domain_zone_info_RECORD_DOES_NOT_EXIST(self, method, url, body, headers):
-        body = self.fixtures.load('list_zones.xml')
-        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
-
-    def _xmlrpc__domain_zone_record_delete_RECORD_DOES_NOT_EXIST(self, method, url, body,
headers):
-        body = self.fixtures.load('delete_record_doesnotexist.xml')
-        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
-
-    def _xmlrpc__domain_zone_version_new_RECORD_DOES_NOT_EXIST(self, method, url, body, headers):
-        body = self.fixtures.load('new_version.xml')
-        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
-
-    def _xmlrpc__domain_zone_version_set_RECORD_DOES_NOT_EXIST(self, method, url, body, headers):
-        body = self.fixtures.load('new_version.xml')
-        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
-
-
-class DummyTransport(MockGandiTransport):
-    mockCls = GandiMockHttp
-
-
-class GandiTests(BaseGandiTests):
-
-    driverCls = GandiDNSDriver
-    transportCls = DummyTransport
-    params = DNS_GANDI
+    def setUp(self):
+        GandiDNSDriver.connectionCls.conn_classes = (
+            GandiMockHttp, GandiMockHttp)
+        GandiMockHttp.type = None
+        self.driver = GandiDNSDriver(*DNS_GANDI)
 
     def test_list_record_types(self):
         record_types = self.driver.list_record_types()
@@ -285,5 +200,97 @@ class GandiTests(BaseGandiTests):
             self.fail('Exception was not thrown')
 
 
+class GandiMockHttp(BaseGandiMockHttp):
+    fixtures = DNSFileFixtures('gandi')
+
+    def _xmlrpc__domain_zone_create(self, method, url, body, headers):
+        body = self.fixtures.load('create_zone.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__domain_zone_update(self, method, url, body, headers):
+        body = self.fixtures.load('get_zone.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__domain_zone_list(self, method, url, body, headers):
+        body = self.fixtures.load('list_zones.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__domain_zone_record_list(self, method, url, body, headers):
+        body = self.fixtures.load('list_records.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__domain_zone_record_add(self, method, url, body, headers):
+        body = self.fixtures.load('create_record.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__domain_zone_delete(self, method, url, body, headers):
+        body = self.fixtures.load('delete_zone.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__domain_zone_info(self, method, url, body, headers):
+        body = self.fixtures.load('get_zone.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__domain_zone_record_delete(self, method, url, body, headers):
+        body = self.fixtures.load('delete_record.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__domain_zone_record_update(self, method, url, body, headers):
+        body = self.fixtures.load('create_record.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__domain_zone_version_new(self, method, url, body, headers):
+        body = self.fixtures.load('new_version.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__domain_zone_version_set(self, method, url, body, headers):
+        body = self.fixtures.load('new_version.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__domain_zone_record_list_ZONE_DOES_NOT_EXIST(self, method, url,
+                                                             body, headers):
+        body = self.fixtures.load('zone_doesnt_exist.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__domain_zone_info_ZONE_DOES_NOT_EXIST(self, method, url, body,
+                                                      headers):
+        body = self.fixtures.load('zone_doesnt_exist.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__domain_zone_list_ZONE_DOES_NOT_EXIST(self, method, url, body,
+                                                      headers):
+        body = self.fixtures.load('zone_doesnt_exist.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__domain_zone_delete_ZONE_DOES_NOT_EXIST(self, method, url,
+                                                        body, headers):
+        body = self.fixtures.load('zone_doesnt_exist.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__domain_zone_record_list_RECORD_DOES_NOT_EXIST(
+            self, method, url, body, headers):
+        body = self.fixtures.load('list_records_empty.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__domain_zone_info_RECORD_DOES_NOT_EXIST(self, method, url,
+                                                        body, headers):
+        body = self.fixtures.load('list_zones.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__domain_zone_record_delete_RECORD_DOES_NOT_EXIST(
+            self, method, url, body, headers):
+        body = self.fixtures.load('delete_record_doesnotexist.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__domain_zone_version_new_RECORD_DOES_NOT_EXIST(
+            self, method, url, body, headers):
+        body = self.fixtures.load('new_version.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__domain_zone_version_set_RECORD_DOES_NOT_EXIST(
+            self, method, url, body, headers):
+        body = self.fixtures.load('new_version.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
 if __name__ == '__main__':
     sys.exit(unittest.main())



Mime
View raw message