• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python wrappers.expect_exact函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中wrappers.expect_exact函数的典型用法代码示例。如果您正苦于以下问题:Python expect_exact函数的具体用法?Python expect_exact怎么用?Python expect_exact使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了expect_exact函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: step_send_source_command

def step_send_source_command(context):
    with tempfile.NamedTemporaryFile() as f:
        f.write(b'\?')
        f.flush()
        context.cli.sendline('\i {0}'.format(f.name))
        wrappers.expect_exact(
            context, context.conf['pager_boundary'] + '\r\n', timeout=5)
开发者ID:catherinedevlin,项目名称:pgcli,代码行数:7,代码来源:basic_commands.py


示例2: step_send_source_command

def step_send_source_command(context):
    context.tmpfile_sql_help = tempfile.NamedTemporaryFile(prefix='pgcli_')
    context.tmpfile_sql_help.write(b'\?')
    context.tmpfile_sql_help.flush()
    context.cli.sendline('\i {0}'.format(context.tmpfile_sql_help.name))
    wrappers.expect_exact(
        context, context.conf['pager_boundary'] + '\r\n', timeout=5)
开发者ID:dbcli,项目名称:pgcli,代码行数:7,代码来源:basic_commands.py


示例3: step_see_container_unpaused

def step_see_container_unpaused(context, container_name):
    """
    Check container is running.
    """
    wrappers.expect_exact(context, container_name + '\r\n')
    context.cli.sendline('ps')
    wrappers.expect(context, r'Up [a-zA-Z0-9\s]+\s{2,}')
开发者ID:j-bennet,项目名称:wharfee,代码行数:7,代码来源:3_container_commands.py


示例4: step_see_container_paused

def step_see_container_paused(context, container_name):
    """
    Check container is paused.
    """
    wrappers.expect_exact(context, container_name + '\r\n')
    context.cli.sendline('ps')
    wrappers.expect_exact(context, ' (Paused)')
开发者ID:j-bennet,项目名称:wharfee,代码行数:7,代码来源:3_container_commands.py


示例5: step_edit_done_sql

def step_edit_done_sql(context):
    for match in 'select * from abc'.split(' '):
        wrappers.expect_exact(context, match, timeout=1)
    # Cleanup the command line.
    context.cli.sendcontrol('c')
    # Cleanup the edited file.
    if context.editor_file_name and os.path.exists(context.editor_file_name):
        os.remove(context.editor_file_name)
开发者ID:koljonen,项目名称:pgcli,代码行数:8,代码来源:iocommands.py


示例6: step_db_drop

def step_db_drop(context):
    """Send drop database."""
    context.cli.sendline('drop database {0};'.format(
        context.conf['dbname_tmp']))

    wrappers.expect_exact(
        context, 'You\'re about to run a destructive command.\r\nDo you want to proceed? (y/n):', timeout=2)
    context.cli.sendline('y')
开发者ID:DaveXanderXU,项目名称:mycli,代码行数:8,代码来源:crud_database.py


示例7: step_see_prompt

def step_see_prompt(context):
    """Wait to see the prompt."""
    user = context.conf['user']
    host = context.conf['host']
    dbname = context.currentdb
    wrappers.expect_exact(context, '{0}@{1}:{2}> '.format(
        user, host, dbname), timeout=5)
    context.atprompt = True
开发者ID:dbcli,项目名称:mycli,代码行数:8,代码来源:crud_database.py


示例8: step_see_large_results

def step_see_large_results(context):
    rows = ['{n:3}| {n}'.format(n=str(n)) for n in range(1, 50)]
    expected = ('***************************[ 1. row ]'
                '***************************\r\n' +
                '{}\r\n'.format('\r\n'.join(rows) + '\r\n'))

    wrappers.expect_pager(context, expected, timeout=5)
    wrappers.expect_exact(context, '1 row in set', timeout=2)
开发者ID:dbcli,项目名称:mycli,代码行数:8,代码来源:auto_vertical.py


示例9: step_see_small_results

def step_see_small_results(context):
    wrappers.expect_pager(context, dedent("""\
        +---+\r
        | 1 |\r
        +---+\r
        | 1 |\r
        +---+\r
        """), timeout=5)
    wrappers.expect_exact(context, '1 row in set', timeout=2)
开发者ID:DaveXanderXU,项目名称:mycli,代码行数:9,代码来源:auto_vertical.py


示例10: step_send_help

def step_send_help(context):
    """Send \?

    to see help.

    """
    context.cli.sendline('\\?')
    wrappers.expect_exact(
        context, context.conf['pager_boundary'] + '\r\n', timeout=5)
开发者ID:DaveXanderXU,项目名称:mycli,代码行数:9,代码来源:basic_commands.py


示例11: step_query_select_123456

def step_query_select_123456(context):
    context.cli.sendline('select 123456')
    wrappers.expect_pager(context, dedent("""\
        +--------+\r
        | 123456 |\r
        +--------+\r
        | 123456 |\r
        +--------+\r
        """), timeout=5)
    wrappers.expect_exact(context, '1 row in set', timeout=2)
开发者ID:DaveXanderXU,项目名称:mycli,代码行数:10,代码来源:iocommands.py


示例12: step_see_image_pulled

def step_see_image_pulled(context, image_name):
    """
    Expect to see image pulled.
    """
    wrappers.expect_exact(context, [
        'Downloaded newer image for ' + image_name,
        'Image is up to date for ' + image_name,
        'Pull complete',
        'Download complete'],
        timeout=180)
开发者ID:j-bennet,项目名称:wharfee,代码行数:10,代码来源:2_image_commands.py


示例13: step_see_null_selected

def step_see_null_selected(context):
    """Wait to see null output."""
    wrappers.expect_pager(
        context, dedent("""\
            +--------+\r
            | NULL   |\r
            +--------+\r
            | <null> |\r
            +--------+\r
            """), timeout=1)
    wrappers.expect_exact(context, '1 row in set', timeout=2)
开发者ID:DaveXanderXU,项目名称:mycli,代码行数:11,代码来源:crud_table.py


示例14: step_see_data_selected

def step_see_data_selected(context):
    """Wait to see select output."""
    wrappers.expect_pager(
        context, dedent("""\
            +-----+\r
            | x   |\r
            +-----+\r
            | yyy |\r
            +-----+\r
            """), timeout=1)
    wrappers.expect_exact(context, '1 row in set', timeout=2)
开发者ID:DaveXanderXU,项目名称:mycli,代码行数:11,代码来源:crud_table.py


示例15: step_edit_file

def step_edit_file(context):
    """Edit file with external editor."""
    context.editor_file_name = os.path.join(
        context.package_root, 'test_file_{0}.sql'.format(context.conf['vi']))
    if os.path.exists(context.editor_file_name):
        os.remove(context.editor_file_name)
    context.cli.sendline('\e {0}'.format(
        os.path.basename(context.editor_file_name)))
    wrappers.expect_exact(
        context, 'Entering Ex mode.  Type "visual" to go to Normal mode.', timeout=2)
    wrappers.expect_exact(context, '\r\n:', timeout=2)
开发者ID:koljonen,项目名称:pgcli,代码行数:11,代码来源:iocommands.py


示例16: step_see_db_dropped_no_default

def step_see_db_dropped_no_default(context):
    """Wait to see drop database output."""
    user = context.conf['user']
    host = context.conf['host']
    database = '(none)'
    context.currentdb = None

    wrappers.expect_exact(context, 'Query OK, 0 rows affected', timeout=2)
    wrappers.expect_exact(context, '{0}@{1}:{2}> '.format(
        user, host, database), timeout=5)

    context.atprompt = True
开发者ID:dbcli,项目名称:mycli,代码行数:12,代码来源:crud_database.py


示例17: step_prepare_data

def step_prepare_data(context):
    """Create table, insert a record."""
    context.cli.sendline('drop table if exists a;')
    wrappers.expect_exact(
        context, 'You\'re about to run a destructive command.\r\nDo you want to proceed? (y/n):', timeout=2)
    context.cli.sendline('y')

    wrappers.wait_prompt(context)
    context.cli.sendline(
        'create table a(x integer, y real, z numeric(10, 4));')
    wrappers.expect_pager(context, 'CREATE TABLE\r\n', timeout=2)
    context.cli.sendline('''insert into a(x, y, z) values(1, 1.0, 1.0);''')
    wrappers.expect_pager(context, 'INSERT 0 1\r\n', timeout=2)
开发者ID:dbcli,项目名称:pgcli,代码行数:13,代码来源:expanded.py


示例18: step_see_found

def step_see_found(context):
    wrappers.expect_exact(
        context,
        context.conf['pager_boundary'] + '\r' + dedent('''
            +------------+\r
            | ?column?   |\r
            |------------|\r
            | found      |\r
            +------------+\r
            SELECT 1\r
        ''') + context.conf['pager_boundary'],
        timeout=5
    )
开发者ID:catherinedevlin,项目名称:pgcli,代码行数:13,代码来源:basic_commands.py


示例19: step_tee_ouptut

def step_tee_ouptut(context):
    context.tee_file_name = os.path.join(
        context.package_root, 'tee_file_{0}.sql'.format(context.conf['vi']))
    if os.path.exists(context.tee_file_name):
        os.remove(context.tee_file_name)
    context.cli.sendline('\o {0}'.format(
        os.path.basename(context.tee_file_name)))
    wrappers.expect_exact(
        context, context.conf['pager_boundary'] + '\r\n', timeout=5)
    wrappers.expect_exact(context, "Writing to file", timeout=5)
    wrappers.expect_exact(
        context, context.conf['pager_boundary'] + '\r\n', timeout=5)
    wrappers.expect_exact(context, "Time", timeout=5)
开发者ID:koljonen,项目名称:pgcli,代码行数:13,代码来源:iocommands.py


示例20: step_see_db_connected

def step_see_db_connected(context):
    """Wait to see drop database output."""
    wrappers.expect_exact(
        context, 'You are now connected to database "', timeout=2)
    wrappers.expect_exact(context, '"', timeout=2)
    wrappers.expect_exact(context, ' as user "{0}"'.format(
        context.conf['user']), timeout=2)
开发者ID:dbcli,项目名称:mycli,代码行数:7,代码来源:crud_database.py



注:本文中的wrappers.expect_exact函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python db.dbFinalize函数代码示例发布时间:2022-05-26
下一篇:
Python wrappermap.wrapper函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap