[ 
https://issues.apache.org/jira/browse/LIBCLOUD-102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068717#comment-13068717
 ] 

Tomaz Muraus commented on LIBCLOUD-102:
---------------------------------------

I have pushed a change which should fix the problem.

I am still not sure why I can't get it to fail locally or on buildbot with 
Python 2.7. I definitely use a standard library unittest module which comes 
with Python 2.7.

> Rackspace loadbalancer tests fail under 2.7
> -------------------------------------------
>
>                 Key: LIBCLOUD-102
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-102
>             Project: Libcloud
>          Issue Type: Bug
>         Environment: Python 2.7 (virtualenv), MacOS X 10.6.8
>            Reporter: Benno Rice
>            Assignee: Roman Bogorodskiy
>              Labels: test
>         Attachments: rackspace_loadbalancer_tests.patch
>
>
> The unittest module in 2.7 has grown some extra magic used by assertEqual.  
> There are some support variables for this that only get set if 
> unittest.TestCase.__init__ is run.  
> test.loadbalancer.test_rackspace.RackspaceLBMockHttp inherits from 
> unittest.TestCase but never calls its __init__ method and so you get failures 
> like this:
> ======================================================================
> ERROR: test_create_balancer (__main__.RackspaceUKLBTests)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "test/loadbalancer/test_rackspace.py", line 60, in test_create_balancer
>     Member(None, '10.1.0.11', 80))
>   File 
> "/Users/benno/ninefold/libcloud/libcloud/loadbalancer/drivers/rackspace.py", 
> line 114, in create_balancer
>     data=json.dumps(balancer_object))
>   File 
> "/Users/benno/ninefold/libcloud/libcloud/loadbalancer/drivers/rackspace.py", 
> line 67, in request
>     params=params, data=data, method=method, headers=headers)
>   File "/Users/benno/ninefold/libcloud/libcloud/common/base.py", line 390, in 
> request
>     headers=headers)
>   File "/Users/benno/ninefold/libcloud/test/__init__.py", line 161, in request
>     status, body, headers, reason = meth(method, url, body, headers)
>   File "test/loadbalancer/test_rackspace.py", line 133, in 
> _v1_0_slug_loadbalancers
>     self.assertEqual(body_json['loadBalancer']['protocol'], 'HTTP')
>   File 
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py",
>  line 493, in assertEqual
>     assertion_func = self._getAssertEqualityFunc(first, second)
>   File 
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py",
>  line 476, in _getAssertEqualityFunc
>     asserter = self._type_equality_funcs.get(type(first))
> AttributeError: 'RackspaceLBMockHttp' object has no attribute 
> '_type_equality_funcs'
> ----------------------------------------------------------------------
> Attached patch fixes the problem but in a somewhat hackish manner.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to