You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@libcloud.apache.org by "Tomaz Muraus (Closed) (JIRA)" <ji...@apache.org> on 2011/10/20 01:17:11 UTC

[dev] [jira] [Closed] (LIBCLOUD-102) Rackspace loadbalancer tests fail under 2.7

     [ https://issues.apache.org/jira/browse/LIBCLOUD-102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tomaz Muraus closed LIBCLOUD-102.
---------------------------------

    
> 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: Tomaz Muraus
>              Labels: test
>             Fix For: 0.6.0
>
>         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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira