summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDick Marinus <dick@mrns.nl>2018-05-19 07:20:55 +0200
committerGitHub <noreply@github.com>2018-05-19 07:20:55 +0200
commitd01b4eeb6479c951a8b0ee10e29099af9eaf6e5e (patch)
tree5b00fc9c407cae142f7afae12fa150f2516fd527 /tests
parentfc41a5e8daf40baad292b4a4d9a0228d83bc2e35 (diff)
parent3c26ddf4c3273a06db85ada4ea06cb3952ca89a6 (diff)
Merge pull request #885 from dbcli/pr884
Add confirmation prompt to destructive commands in behave tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/features/steps/crud_database.py3
-rw-r--r--tests/features/steps/crud_table.py6
-rw-r--r--tests/features/steps/expanded.py4
3 files changed, 13 insertions, 0 deletions
diff --git a/tests/features/steps/crud_database.py b/tests/features/steps/crud_database.py
index f049ee7e..4a1a9d14 100644
--- a/tests/features/steps/crud_database.py
+++ b/tests/features/steps/crud_database.py
@@ -32,6 +32,9 @@ 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')
diff --git a/tests/features/steps/crud_table.py b/tests/features/steps/crud_table.py
index 360f78f9..55c31da7 100644
--- a/tests/features/steps/crud_table.py
+++ b/tests/features/steps/crud_table.py
@@ -49,6 +49,9 @@ 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')
@@ -57,6 +60,9 @@ 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')
diff --git a/tests/features/steps/expanded.py b/tests/features/steps/expanded.py
index 5360ea22..b1970a34 100644
--- a/tests/features/steps/expanded.py
+++ b/tests/features/steps/expanded.py
@@ -16,6 +16,10 @@ from textwrap import dedent
def step_prepare_data(context):
"""Create table, insert a record."""
context.cli.sendline('drop table if exists 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')
+
wrappers.wait_prompt(context)
context.cli.sendline(
'create table a(x integer, y real, z numeric(10, 4));')