1
1
mirror of https://github.com/dbcli/pgcli.git synced 2024-09-11 13:56:36 +03:00

Merge pull request #1116 from dbcli/test_

Add a test to verify error message.
This commit is contained in:
Amjith Ramanujam 2019-10-25 22:21:51 -07:00 committed by GitHub
commit 199a0223e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View File

@ -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

View File

@ -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_")