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/03/15 17:26:14 UTC

svn commit: r1081839 - in /incubator/libcloud/trunk: libcloud/compute/drivers/elastichosts.py test/compute/test_elastichosts.py

Author: tomaz
Date: Tue Mar 15 16:26:14 2011
New Revision: 1081839

URL: http://svn.apache.org/viewvc?rev=1081839&view=rev
Log:
Add "medium" size to the elastichosts driver.

Modified:
    incubator/libcloud/trunk/libcloud/compute/drivers/elastichosts.py
    incubator/libcloud/trunk/test/compute/test_elastichosts.py

Modified: incubator/libcloud/trunk/libcloud/compute/drivers/elastichosts.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/compute/drivers/elastichosts.py?rev=1081839&r1=1081838&r2=1081839&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/compute/drivers/elastichosts.py (original)
+++ incubator/libcloud/trunk/libcloud/compute/drivers/elastichosts.py Tue Mar 15 16:26:14 2011
@@ -69,6 +69,14 @@ INSTANCE_TYPES = {
         'disk': 160,
         'bandwidth': None,
     },
+    'medium': {
+        'id': 'medium',
+        'name': 'Medium instance',
+        'cpu': 3000,
+        'memory': 4096,
+        'disk': 500,
+        'bandwidth': None,
+    },
     'large': {
         'id': 'large',
         'name': 'Large instance',

Modified: incubator/libcloud/trunk/test/compute/test_elastichosts.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/compute/test_elastichosts.py?rev=1081839&r1=1081838&r2=1081839&view=diff
==============================================================================
--- incubator/libcloud/trunk/test/compute/test_elastichosts.py (original)
+++ incubator/libcloud/trunk/test/compute/test_elastichosts.py Tue Mar 15 16:26:14 2011
@@ -34,7 +34,7 @@ class ElasticHostsTestCase(unittest.Test
         nodes = self.driver.list_nodes()
         self.assertTrue(isinstance(nodes, list))
         self.assertEqual(len(nodes), 1)
-        
+
         node = nodes[0]
         self.assertEqual(node.public_ip[0], "1.2.3.4")
         self.assertEqual(node.public_ip[1], "1.2.3.5")
@@ -42,8 +42,8 @@ class ElasticHostsTestCase(unittest.Test
 
     def test_list_sizes(self):
         images = self.driver.list_sizes()
-        self.assertEqual(len(images), 5)
-        image = images[0]
+        self.assertEqual(len(images), 6)
+        image = [i for i in images if i.id == 'small'][0]
         self.assertEqual(image.id, 'small')
         self.assertEqual(image.name, 'Small instance')
         self.assertEqual(image.cpu, 2000)
@@ -56,7 +56,7 @@ class ElasticHostsTestCase(unittest.Test
         size = sizes[0]
         self.assertEqual(size.id, '38df0986-4d85-4b76-b502-3878ffc80161')
         self.assertEqual(size.name, 'CentOS Linux 5.5')
-        
+
     def test_list_locations_response(self):
         pass
 
@@ -76,24 +76,24 @@ class ElasticHostsTestCase(unittest.Test
 class ElasticHostsHttp(MockHttp):
 
     fixtures = ComputeFileFixtures('elastichosts')
-    
+
     def _servers_b605ca90_c3e6_4cee_85f8_a8ebdf8f9903_reset(self, method, url, body, headers):
          return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT])
-    
+
     def _servers_b605ca90_c3e6_4cee_85f8_a8ebdf8f9903_destroy(self, method, url, body, headers):
          return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT])
-    
+
     def _drives_create(self, method, url, body, headers):
         body = self.fixtures.load('drives_create.json')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
-    
+
     def _drives_0012e24a_6eae_4279_9912_3432f698cec8_image_38df0986_4d85_4b76_b502_3878ffc80161_gunzip(self, method, url, body, headers):
         return (httplib.NO_CONTENT, body, {}, httplib.responses[httplib.NO_CONTENT])
 
     def _drives_0012e24a_6eae_4279_9912_3432f698cec8_info(self, method, url, body, headers):
         body = self.fixtures.load('drives_info.json')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
-    
+
     def _servers_create(self, method, url, body, headers):
         body = self.fixtures.load('servers_create.json')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])