def session_block_56160(setting_name):
    """
    Common fixture with the data of block 56160
    """
    add_block(setting_name, 56160)
    session = Session(setting_name)
    push_session(session=session)
def session_first_10_blocks(setting_name):
    """
    Common fixture which creates missing blocks in the database
    """
    runner = CliRunner()
    runner.invoke(cli, [
        '--settings', setting_name, 'scrape_block_range', '--end_block_number',
        10
    ])
    session = Session(setting_name)
    push_session(session=session)
def session_block_range_56160_56170(setting_name):
    """
    Common fixture with data between block 56160 and 56170
    """
    runner = CliRunner()
    runner.invoke(cli, [
        '--settings', setting_name, 'scrape_block_range',
        '--start_block_number', 56160, '--end_block_number', 56170,
        '--no-fill_gaps'
    ])
    session = Session(setting_name)
    push_session(session=session)
def session_missing_blocks(setting_name):
    """
    Common fixture which creates missing blocks in the database
    """
    add_block(setting_name, 0)
    add_block(setting_name, 2)
    add_block(setting_name, 4)
    runner = CliRunner()
    runner.invoke(cli, [
        '--settings', setting_name, 'scrape_block_range', '--end_block_number',
        10, '--no-fill_gaps'
    ])
    session = Session(setting_name)
    push_session(session=session)
Beispiel #5
0
def init_celery_session(**kwargs):
    logger.info('Initializing session for PID {}.'.format(os.getpid()))
    session = get_current_session()
    logger.info("PID {} connected to {}".format(os.getpid(), session.url))
    push_session(session)
Beispiel #6
0
def cli(ctx, settings):
    """:code:`ether_sql` is the most basic CLI group with 4 subsequent
    commands."""
    current_session = Session(setting_name=settings)
    push_session(current_session)