def setUp(self): self.timeout = 10 OpenStackBaseConnection.conn_class = 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 setUp(self): self.timeout = 10 OpenStackBaseConnection.conn_class = 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 _get_mock_connection(self, mock_http_class, auth_url=None): OpenStackBaseConnection.conn_class = mock_http_class if auth_url is None: auth_url = "https://auth.api.example.com" OpenStackBaseConnection.auth_url = auth_url connection = OpenStackBaseConnection(*OPENSTACK_PARAMS) connection._ex_force_base_url = "https://www.foo.com" connection.driver = OpenStack_1_0_NodeDriver(*OPENSTACK_PARAMS) return connection