Ejemplo n.º 1
0
 def setUp(self):
     self.timeout = 10
     OpenStack_Esh_Connection.conn_classes = (None, Mock())
     self.connection = OpenStack_Esh_Connection(
         'foo',
         'bar',
         timeout=self.timeout,
         ex_force_auth_url='https://127.0.0.1')
     self.connection.driver = Mock()
     self.connection.driver.name = 'OpenStackEshDriver'
Ejemplo n.º 2
0
class OpenStackEshConnectionTest(unittest.TestCase):
    def setUp(self):
        self.timeout = 10
        OpenStack_Esh_Connection.conn_classes = (None, Mock())
        self.connection = OpenStack_Esh_Connection('foo', 'bar',
                                                  timeout=self.timeout,
                                                  ex_force_auth_url='https://127.0.0.1')
        self.connection.driver = Mock()
        self.connection.driver.name = 'OpenStackEshDriver'

    def test_timeout(self):
        self.connection.connect()
        self.assertEqual(self.connection.timeout, self.timeout)
        self.connection.conn_classes[1].assert_called_with(host='127.0.0.1',
                                                           port=443,
                                                           timeout=10)
Ejemplo n.º 3
0
 def setUp(self):
     self.timeout = 10
     OpenStack_Esh_Connection.conn_classes = (None, Mock())
     self.connection = OpenStack_Esh_Connection('foo', 'bar',
                                               timeout=self.timeout,
                                               ex_force_auth_url='https://127.0.0.1')
     self.connection.driver = Mock()
     self.connection.driver.name = 'OpenStackEshDriver'
Ejemplo n.º 4
0
class OpenStackEshConnectionTest(unittest.TestCase):
    def setUp(self):
        self.timeout = 10
        OpenStack_Esh_Connection.conn_classes = (None, Mock())
        self.connection = OpenStack_Esh_Connection(
            'foo',
            'bar',
            timeout=self.timeout,
            ex_force_auth_url='https://127.0.0.1')
        self.connection.driver = Mock()
        self.connection.driver.name = 'OpenStackEshDriver'

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