import sys
import unittest

from mock import Mock

from libcloud.common.openstack import OpenStackBaseConnection


class OpenStackBaseConnectionTest(unittest.TestCase):

    def setUp(self):
        self.timeout = 10
        OpenStackBaseConnection.conn_classes = (None, Mock())
        self.connection = OpenStackBaseConnection('foo', 'bar',
                                                  timeout=self.timeout,
                                                  ex_force_auth_url='https://127.0.0.1')
        self.connection.driver = Mock()
        self.connection.driver.name = 'OpenStackDriver'

    def test_base_connection_timeout(self):
        self.connection.connect()
        self.assertEquals(self.connection.timeout, self.timeout)
        self.connection.conn_classes[1].assert_called_with(host='127.0.0.1',
                                                           port=443,
                                                           timeout=10)


if __name__ == '__main__':
    sys.exit(unittest.main())

@@ -106,16 +106,52 @@
 nection%0A
+from libcloud.utils.py3 import PY25%0A
 %0A%0Aclass 
@@ -773,16 +773,37 @@
 imeout)%0A
+        if PY25:%0A    
         
@@ -934,16 +934,20 @@
     
+    
 port=443
 ,%0A  
@@ -942,18 +942,190 @@
 port=443
-,%0A
+)%0A        else:%0A            self.connection.conn_classes%5B1%5D.assert_called_with(host='127.0.0.1',%0A                                                               port=443,%0A    
         

Fix test so it works with python 2.5.