diff options
author | Amjith Ramanujam <amjith.r@gmail.com> | 2019-10-23 21:00:45 -0700 |
---|---|---|
committer | Amjith Ramanujam <amjith.r@gmail.com> | 2019-10-23 21:00:45 -0700 |
commit | f658e3d1b405be891f8193a3ff6e1fd74812f64f (patch) | |
tree | 28739889bdf848b0f77c7a57f317590192d964f6 | |
parent | f25e49555aa53c740baaf685e9ed4b34a0a5b6f2 (diff) |
Add a test to verify error message.
-rw-r--r-- | tests/features/basic_commands.feature | 5 | ||||
-rw-r--r-- | tests/features/steps/basic_commands.py | 14 |
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/features/basic_commands.feature b/tests/features/basic_commands.feature index 1f63a8ad..99f893e2 100644 --- a/tests/features/basic_commands.feature +++ b/tests/features/basic_commands.feature @@ -10,6 +10,11 @@ Feature: run the cli, When we send source command then we see help output + Scenario: run partial select command + When we send partial select command + then we see error message + then we see dbcli prompt + Scenario: check our application_name When we run query to check application_name then we see found diff --git a/tests/features/steps/basic_commands.py b/tests/features/steps/basic_commands.py index b9ab0046..bda163f6 100644 --- a/tests/features/steps/basic_commands.py +++ b/tests/features/steps/basic_commands.py @@ -82,6 +82,20 @@ def step_send_help(context): context.cli.sendline("\?") +@when("we send partial select command") +def step_send_partial_select_command(context): + """ + Send `SELECT a` to see completion. + """ + context.cli.sendline("SELECT a") + + +@then("we see error message") +def step_see_error_message(context): + wrappers.expect_exact(context, 'column "a" does not exist', timeout=2) + wrappers.wait_prompt(context) + + @when("we send source command") def step_send_source_command(context): context.tmpfile_sql_help = tempfile.NamedTemporaryFile(prefix="pgcli_") |