diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-09-21 01:44:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-09-21 01:44:53 +0000 |
commit | 97864fef063b0960fd3df4529c561296e7805e8c (patch) | |
tree | e0f84cbf2df15e6c8dafb6161babb551d6b6fda6 /tests/features/steps | |
parent | Releasing debian version 3.4.1-1. (diff) | |
download | pgcli-97864fef063b0960fd3df4529c561296e7805e8c.tar.xz pgcli-97864fef063b0960fd3df4529c561296e7805e8c.zip |
Merging upstream version 3.5.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/features/steps')
-rw-r--r-- | tests/features/steps/basic_commands.py | 2 | ||||
-rw-r--r-- | tests/features/steps/crud_database.py | 2 | ||||
-rw-r--r-- | tests/features/steps/pgbouncer.py | 22 | ||||
-rw-r--r-- | tests/features/steps/wrappers.py | 3 |
4 files changed, 26 insertions, 3 deletions
diff --git a/tests/features/steps/basic_commands.py b/tests/features/steps/basic_commands.py index a7c99ee..7c87814 100644 --- a/tests/features/steps/basic_commands.py +++ b/tests/features/steps/basic_commands.py @@ -69,7 +69,7 @@ def step_ctrl_d(context): context.cli.sendline(r"\pset pager off") wrappers.wait_prompt(context) context.cli.sendcontrol("d") - context.cli.expect(pexpect.EOF, timeout=15) + context.cli.expect(pexpect.EOF, timeout=5) context.exit_sent = True diff --git a/tests/features/steps/crud_database.py b/tests/features/steps/crud_database.py index 3f5d0e7..87cdc85 100644 --- a/tests/features/steps/crud_database.py +++ b/tests/features/steps/crud_database.py @@ -59,7 +59,7 @@ def step_see_prompt(context): Wait to see the prompt. """ db_name = getattr(context, "currentdb", context.conf["dbname"]) - wrappers.expect_exact(context, f"{db_name}> ", timeout=5) + wrappers.expect_exact(context, f"{db_name}>", timeout=5) context.atprompt = True diff --git a/tests/features/steps/pgbouncer.py b/tests/features/steps/pgbouncer.py new file mode 100644 index 0000000..f156982 --- /dev/null +++ b/tests/features/steps/pgbouncer.py @@ -0,0 +1,22 @@ +""" +Steps for behavioral style tests are defined in this module. +Each step is defined by the string decorating it. +This string is used to call the step in "*.feature" file. +""" + +from behave import when, then +import wrappers + + +@when('we send "show help" command') +def step_send_help_command(context): + context.cli.sendline("show help") + + +@then("we see the pgbouncer help output") +def see_pgbouncer_help(context): + wrappers.expect_exact( + context, + "SHOW HELP|CONFIG|DATABASES|POOLS|CLIENTS|SERVERS|USERS|VERSION", + timeout=3, + ) diff --git a/tests/features/steps/wrappers.py b/tests/features/steps/wrappers.py index 0ca8366..6180517 100644 --- a/tests/features/steps/wrappers.py +++ b/tests/features/steps/wrappers.py @@ -70,4 +70,5 @@ def run_cli(context, run_args=None, prompt_check=True, currentdb=None): def wait_prompt(context): """Make sure prompt is displayed.""" - expect_exact(context, "{0}> ".format(context.conf["dbname"]), timeout=5) + prompt_str = "{0}>".format(context.currentdb) + expect_exact(context, [prompt_str + " ", prompt_str, pexpect.EOF], timeout=3) |