def test_get_nova_client(self):
    self.patch_object(api_crud, 'nova_client')
    self.patch_object(api_crud.ch_core.hookenv, 'config')
    self.config.return_value = 'someregion'
    self.patch_object(api_crud, 'endpoint_type')
    self.endpoint_type.return_value = 'someeptype'
    api_crud.get_nova_client('somesession')
    self.config.assert_called_once_with('region')
    self.nova_client.Client.assert_called_once_with('2', session='somesession', region_name='someregion', endpoint_type='someeptype')
def test_get_nova_client(self):
    self.patch_object(api_crud, 'nova_client')
    self.patch_object(api_crud.ch_core.hookenv, 'config')
    self.config.return_value = 'someregion'
    self.patch_object(api_crud, 'endpoint_type')
    self.endpoint_type.return_value = 'someeptype'
    api_crud.get_nova_client('somesession')
    self.config.assert_called_once_with('region')
    self.nova_client.Client.assert_called_once_with('2', session='somesession', region_name='someregion', endpoint_type='someeptype')