Пример #1
0
    def setUp(self):
        from cliquet.storage.postgresql.client import create_from_config

        self.connections = []
        self.errors = []

        config = testing.setUp(settings={
            'pooltest_url': 'sqlite:///:memory:',
            'pooltest_pool_size': 2,
            'pooltest_pool_timeout': 1,
            'pooltest_max_backlog': 2,
            'pooltest_max_overflow': 1,
        })
        # Create an engine with known pool parameters.
        # Use create_from_config() to make sure it is used by default
        # and handles parameters.
        client = create_from_config(config, prefix='pooltest_')
        session = client.session_factory()
        self.engine = session.get_bind()
Пример #2
0
    def setUp(self):
        from cliquet.storage.postgresql.client import create_from_config

        self.connections = []
        self.errors = []

        config = testing.setUp(
            settings={
                'pooltest_url': 'sqlite:///:memory:',
                'pooltest_pool_size': 2,
                'pooltest_pool_timeout': 1,
                'pooltest_max_backlog': 2,
                'pooltest_max_overflow': 1,
            })
        # Create an engine with known pool parameters.
        # Use create_from_config() to make sure it is used by default
        # and handles parameters.
        client = create_from_config(config, prefix='pooltest_')
        session = client.session_factory()
        self.engine = session.get_bind()
Пример #3
0
def load_from_config(config):
    settings = config.get_settings()
    max_fetch_size = int(settings['storage_max_fetch_size'])
    client = create_from_config(config, prefix='storage_')
    return Storage(client=client, max_fetch_size=max_fetch_size)
Пример #4
0
def load_from_config(config):
    client = create_from_config(config, prefix='cache_')
    return Cache(client=client)
Пример #5
0
def load_from_config(config):
    client = create_from_config(config, prefix='permission_')
    return Permission(client=client)
Пример #6
0
def load_from_config(config):
    settings = config.get_settings()
    client = create_from_config(config, prefix='cache_')
    return Cache(client=client, cache_prefix=settings['cache_prefix'])
Пример #7
0
def load_from_config(config):
    settings = config.get_settings()
    client = create_from_config(config, prefix='cache_')
    return Cache(client=client, cache_prefix=settings['cache_prefix'])
Пример #8
0
def load_from_config(config):
    client = create_from_config(config, prefix='permission_')
    return Permission(client=client)
Пример #9
0
def load_from_config(config):
    settings = config.get_settings()
    max_fetch_size = int(settings['storage_max_fetch_size'])
    client = create_from_config(config, prefix='storage_')
    return Storage(client=client, max_fetch_size=max_fetch_size)