libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1392153 - in /libcloud/trunk/libcloud: storage/drivers/dummy.py test/compute/test_dreamhost.py test/compute/test_softlayer.py test/dns/test_zerigo.py test/storage/test_cloudfiles.py
Date Mon, 01 Oct 2012 01:04:22 GMT
Author: tomaz
Date: Mon Oct  1 01:04:21 2012
New Revision: 1392153

URL: http://svn.apache.org/viewvc?rev=1392153&view=rev
Log:
Fix some of tests failures which happened in Python 3.3 due to randomized
dictionary ordering. Part of LIBCLOUD-245

Modified:
    libcloud/trunk/libcloud/storage/drivers/dummy.py
    libcloud/trunk/libcloud/test/compute/test_dreamhost.py
    libcloud/trunk/libcloud/test/compute/test_softlayer.py
    libcloud/trunk/libcloud/test/dns/test_zerigo.py
    libcloud/trunk/libcloud/test/storage/test_cloudfiles.py

Modified: libcloud/trunk/libcloud/storage/drivers/dummy.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/storage/drivers/dummy.py?rev=1392153&r1=1392152&r2=1392153&view=diff
==============================================================================
--- libcloud/trunk/libcloud/storage/drivers/dummy.py (original)
+++ libcloud/trunk/libcloud/storage/drivers/dummy.py Mon Oct  1 01:04:21 2012
@@ -107,14 +107,22 @@ class DummyStorageDriver(StorageDriver):
     def get_meta_data(self):
         """
         >>> driver = DummyStorageDriver('key', 'secret')
-        >>> driver.get_meta_data()
-        {'object_count': 0, 'container_count': 0, 'bytes_used': 0}
+        >>> driver.get_meta_data()['object_count']
+        0
+        >>> driver.get_meta_data()['container_count']
+        0
+        >>> driver.get_meta_data()['bytes_used']
+        0
         >>> container = driver.create_container(container_name='test container 1')
         >>> container = driver.create_container(container_name='test container 2')
         >>> obj = container.upload_object_via_stream(
         ...  object_name='test object', iterator=DummyFileObject(5, 10), extra={})
-        >>> driver.get_meta_data()
-        {'object_count': 1, 'container_count': 2, 'bytes_used': 50}
+        >>> driver.get_meta_data()['object_count']
+        1
+        >>> driver.get_meta_data()['container_count']
+        2
+        >>> driver.get_meta_data()['bytes_used']
+        50
 
         @rtype: C{dict}
         """

Modified: libcloud/trunk/libcloud/test/compute/test_dreamhost.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/test/compute/test_dreamhost.py?rev=1392153&r1=1392152&r2=1392153&view=diff
==============================================================================
--- libcloud/trunk/libcloud/test/compute/test_dreamhost.py (original)
+++ libcloud/trunk/libcloud/test/compute/test_dreamhost.py Mon Oct  1 01:04:21 2012
@@ -191,11 +191,12 @@ class DreamhostTest(unittest.TestCase, T
         sizes = self.driver.list_sizes()
         self.assertEqual(len(sizes), 5)
 
-        self.assertEqual(sizes[0].id, 'default')
-        self.assertEqual(sizes[0].bandwidth, None)
-        self.assertEqual(sizes[0].disk, None)
-        self.assertEqual(sizes[0].ram, 2300)
-        self.assertEqual(sizes[0].price, 115)
+        size = [s for s in sizes if s.id == 'default'][0]
+        self.assertEqual(size.id, 'default')
+        self.assertEqual(size.bandwidth, None)
+        self.assertEqual(size.disk, None)
+        self.assertEqual(size.ram, 2300)
+        self.assertEqual(size.price, 115)
 
     def test_list_locations(self):
         try:

Modified: libcloud/trunk/libcloud/test/compute/test_softlayer.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/test/compute/test_softlayer.py?rev=1392153&r1=1392152&r2=1392153&view=diff
==============================================================================
--- libcloud/trunk/libcloud/test/compute/test_softlayer.py (original)
+++ libcloud/trunk/libcloud/test/compute/test_softlayer.py Mon Oct  1 01:04:21 2012
@@ -71,7 +71,8 @@ class SoftLayerTests(unittest.TestCase):
     def test_list_sizes(self):
         sizes = self.driver.list_sizes()
         self.assertEqual(len(sizes), 2)
-        self.assertEqual(sizes[0].id, 'sl1')
+        size = [s for s in sizes if s.id == 'sl1']
+        self.assertEqual(len(size), 1)
 
 class SoftLayerMockHttp(MockHttp):
     fixtures = ComputeFileFixtures('softlayer')

Modified: libcloud/trunk/libcloud/test/dns/test_zerigo.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/test/dns/test_zerigo.py?rev=1392153&r1=1392152&r2=1392153&view=diff
==============================================================================
--- libcloud/trunk/libcloud/test/dns/test_zerigo.py (original)
+++ libcloud/trunk/libcloud/test/dns/test_zerigo.py Mon Oct  1 01:04:21 2012
@@ -164,7 +164,6 @@ class ZerigoTests(unittest.TestCase):
                                                extra={'notes':
                                                       'bar foo'})
 
-        self.assertEqual(zone.extra['hostmaster'], '')
         self.assertEqual(zone.extra['notes'], 'test foo bar')
 
         self.assertEqual(updated_zone.id, zone.id)

Modified: libcloud/trunk/libcloud/test/storage/test_cloudfiles.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/test/storage/test_cloudfiles.py?rev=1392153&r1=1392152&r2=1392153&view=diff
==============================================================================
--- libcloud/trunk/libcloud/test/storage/test_cloudfiles.py (original)
+++ libcloud/trunk/libcloud/test/storage/test_cloudfiles.py Mon Oct  1 01:04:21 2012
@@ -640,7 +640,7 @@ class CloudFilesTests(unittest.TestCase)
         ret = self.driver.ex_get_object_temp_url(obj, 'GET')
         temp_url = 'https://storage101.ord1.clouddrive.com/v1/MossoCloudFS/foo_bar_container/foo_bar_object?temp_url_expires=60&temp_url_sig=%s'
% (sig)
 
-        self.assertEquals(ret, temp_url)
+        self.assertEquals(''.join(sorted(ret)), ''.join(sorted(temp_url)))
 
     def test_ex_get_object_temp_url_no_key_raises_key_error(self):
         self.driver.ex_get_meta_data = mock.Mock()



Mime
View raw message