Author: tomaz
Date: Sun Nov 18 23:39:08 2012
New Revision: 1411022
URL: http://svn.apache.org/viewvc?rev=1411022&view=rev
Log:
Backport bug-fix commit from trunk:
Fix some of tests failures which happened in Python 3.3 due to randomized
dictionary ordering. Part of LIBCLOUD-245
Modified:
libcloud/branches/0.11.x/ (props changed)
libcloud/branches/0.11.x/CHANGES
libcloud/branches/0.11.x/libcloud/storage/drivers/dummy.py
libcloud/branches/0.11.x/libcloud/test/compute/test_dreamhost.py
libcloud/branches/0.11.x/libcloud/test/compute/test_softlayer.py
libcloud/branches/0.11.x/libcloud/test/dns/test_zerigo.py
libcloud/branches/0.11.x/libcloud/test/storage/test_cloudfiles.py
Propchange: libcloud/branches/0.11.x/
------------------------------------------------------------------------------
Merged /libcloud/trunk:r1392153
Modified: libcloud/branches/0.11.x/CHANGES
URL:
http://svn.apache.org/viewvc/libcloud/branches/0.11.x/CHANGES?rev=1411022&r1=1411021&r2=1411022&view=diff
==============================================================================
--- libcloud/branches/0.11.x/CHANGES (original)
+++ libcloud/branches/0.11.x/CHANGES Sun Nov 18 23:39:08 2012
@@ -2,9 +2,17 @@
Changes with Apache Libcloud in development:
- - Fix a bug where a numeric instead of a string value was used for the
- content-length header in VCloud driver. ; LIBCLOUD-256
- [Brian DeGeeter, Tomaz Muraus]
+ *) General
+
+ - Fix some of tests failures which happened in Python 3.3 due to randomized
+ dictionary ordering. ; LIBCLOUD-245
+ [Tomaz Muraus]
+
+ *) Compute
+
+ - Fix a bug where a numeric instead of a string value was used for the
+ content-length header in VCloud driver. ; LIBCLOUD-256
+ [Brian DeGeeter, Tomaz Muraus]
*) Storage
Modified: libcloud/branches/0.11.x/libcloud/storage/drivers/dummy.py
URL:
http://svn.apache.org/viewvc/libcloud/branches/0.11.x/libcloud/storage/drivers/dummy.py?rev=1411022&r1=1411021&r2=1411022&view=diff
==============================================================================
--- libcloud/branches/0.11.x/libcloud/storage/drivers/dummy.py (original)
+++ libcloud/branches/0.11.x/libcloud/storage/drivers/dummy.py Sun Nov 18
23:39:08 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/branches/0.11.x/libcloud/test/compute/test_dreamhost.py
URL:
http://svn.apache.org/viewvc/libcloud/branches/0.11.x/libcloud/test/compute/test_dreamhost.py?rev=1411022&r1=1411021&r2=1411022&view=diff
==============================================================================
--- libcloud/branches/0.11.x/libcloud/test/compute/test_dreamhost.py (original)
+++ libcloud/branches/0.11.x/libcloud/test/compute/test_dreamhost.py Sun Nov 18
23:39:08 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/branches/0.11.x/libcloud/test/compute/test_softlayer.py
URL:
http://svn.apache.org/viewvc/libcloud/branches/0.11.x/libcloud/test/compute/test_softlayer.py?rev=1411022&r1=1411021&r2=1411022&view=diff
==============================================================================
--- libcloud/branches/0.11.x/libcloud/test/compute/test_softlayer.py (original)
+++ libcloud/branches/0.11.x/libcloud/test/compute/test_softlayer.py Sun Nov 18
23:39:08 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/branches/0.11.x/libcloud/test/dns/test_zerigo.py
URL:
http://svn.apache.org/viewvc/libcloud/branches/0.11.x/libcloud/test/dns/test_zerigo.py?rev=1411022&r1=1411021&r2=1411022&view=diff
==============================================================================
--- libcloud/branches/0.11.x/libcloud/test/dns/test_zerigo.py (original)
+++ libcloud/branches/0.11.x/libcloud/test/dns/test_zerigo.py Sun Nov 18
23:39:08 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/branches/0.11.x/libcloud/test/storage/test_cloudfiles.py
URL:
http://svn.apache.org/viewvc/libcloud/branches/0.11.x/libcloud/test/storage/test_cloudfiles.py?rev=1411022&r1=1411021&r2=1411022&view=diff
==============================================================================
--- libcloud/branches/0.11.x/libcloud/test/storage/test_cloudfiles.py (original)
+++ libcloud/branches/0.11.x/libcloud/test/storage/test_cloudfiles.py Sun Nov
18 23:39:08 2012
@@ -657,7 +657,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()