Adding upstream version 3.1.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
f2184ff4ed
commit
ec5391b244
104 changed files with 15144 additions and 0 deletions
57
tests/features/steps/named_queries.py
Normal file
57
tests/features/steps/named_queries.py
Normal file
|
@ -0,0 +1,57 @@
|
|||
"""
|
||||
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 save a named query")
|
||||
def step_save_named_query(context):
|
||||
"""
|
||||
Send \ns command
|
||||
"""
|
||||
context.cli.sendline("\\ns foo SELECT 12345")
|
||||
|
||||
|
||||
@when("we use a named query")
|
||||
def step_use_named_query(context):
|
||||
"""
|
||||
Send \n command
|
||||
"""
|
||||
context.cli.sendline("\\n foo")
|
||||
|
||||
|
||||
@when("we delete a named query")
|
||||
def step_delete_named_query(context):
|
||||
"""
|
||||
Send \nd command
|
||||
"""
|
||||
context.cli.sendline("\\nd foo")
|
||||
|
||||
|
||||
@then("we see the named query saved")
|
||||
def step_see_named_query_saved(context):
|
||||
"""
|
||||
Wait to see query saved.
|
||||
"""
|
||||
wrappers.expect_exact(context, "Saved.", timeout=2)
|
||||
|
||||
|
||||
@then("we see the named query executed")
|
||||
def step_see_named_query_executed(context):
|
||||
"""
|
||||
Wait to see select output.
|
||||
"""
|
||||
wrappers.expect_exact(context, "12345", timeout=1)
|
||||
wrappers.expect_exact(context, "SELECT 1", timeout=1)
|
||||
|
||||
|
||||
@then("we see the named query deleted")
|
||||
def step_see_named_query_deleted(context):
|
||||
"""
|
||||
Wait to see query deleted.
|
||||
"""
|
||||
wrappers.expect_pager(context, "foo: Deleted\r\n", timeout=1)
|
Loading…
Add table
Add a link
Reference in a new issue