mirror of https://github.com/dbcli/pgcli
Refactor destructive warning in behave tests
This commit is contained in:
parent
a274c731fc
commit
95fda8218b
|
@ -13,6 +13,7 @@ Internal changes:
|
|||
* Add ``application_name`` to help identify pgcli connection to database (issue #868) (Thanks: `François Pietka`_)
|
||||
* Add an is_special command flag to MetaQuery (Thanks: `Rishi Ramraj`_)
|
||||
* Ported Destructive Warning from mycli.
|
||||
* Refactor Destructive Warning behave tests (Thanks: `Dick Marinus`_)
|
||||
|
||||
Bug Fixes:
|
||||
----------
|
||||
|
|
|
@ -5,6 +5,7 @@ Feature: manipulate databases:
|
|||
When we create database
|
||||
then we see database created
|
||||
when we drop database
|
||||
then we confirm the destructive warning
|
||||
then we see database dropped
|
||||
when we connect to dbserver
|
||||
then we see database connected
|
||||
|
|
|
@ -13,8 +13,10 @@ Feature: manipulate tables:
|
|||
when we select from table
|
||||
then we see data selected
|
||||
when we delete from table
|
||||
then we confirm the destructive warning
|
||||
then we see record deleted
|
||||
when we drop table
|
||||
then we confirm the destructive warning
|
||||
then we see table dropped
|
||||
when we connect to dbserver
|
||||
then we see database connected
|
||||
|
|
|
@ -7,6 +7,7 @@ Feature: expanded mode:
|
|||
and we select from table
|
||||
then we see expanded data selected
|
||||
when we drop table
|
||||
then we confirm the destructive warning
|
||||
then we see table dropped
|
||||
|
||||
Scenario: expanded off
|
||||
|
@ -15,6 +16,7 @@ Feature: expanded mode:
|
|||
and we select from table
|
||||
then we see nonexpanded data selected
|
||||
when we drop table
|
||||
then we confirm the destructive warning
|
||||
then we see table dropped
|
||||
|
||||
Scenario: expanded auto
|
||||
|
@ -23,4 +25,5 @@ Feature: expanded mode:
|
|||
and we select from table
|
||||
then we see auto data selected
|
||||
when we drop table
|
||||
then we confirm the destructive warning
|
||||
then we see table dropped
|
||||
|
|
|
@ -71,3 +71,11 @@ def step_see_found(context):
|
|||
''') + context.conf['pager_boundary'],
|
||||
timeout=5
|
||||
)
|
||||
|
||||
|
||||
@then(u'we confirm the destructive warning')
|
||||
def step_confirm_destructive_command(context):
|
||||
"""Confirm destructive command."""
|
||||
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')
|
||||
|
|
|
@ -32,9 +32,6 @@ def step_db_drop(context):
|
|||
"""
|
||||
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')
|
||||
|
||||
|
||||
@when('we connect to test database')
|
||||
|
|
|
@ -49,9 +49,6 @@ def step_delete_from_table(context):
|
|||
Send deete from table.
|
||||
"""
|
||||
context.cli.sendline('''delete from a where x = 'yyy';''')
|
||||
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')
|
||||
|
||||
|
||||
@when('we drop table')
|
||||
|
@ -60,9 +57,6 @@ def step_drop_table(context):
|
|||
Send drop table.
|
||||
"""
|
||||
context.cli.sendline('drop table 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')
|
||||
|
||||
|
||||
@then('we see table created')
|
||||
|
|
Loading…
Reference in New Issue