summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAmjith Ramanujam <amjith.r@gmail.com>2018-05-18 21:48:21 -0700
committerGitHub <noreply@github.com>2018-05-18 21:48:21 -0700
commit9ae9df624fbef44003cb5e28f963074fee1ea1ee (patch)
tree07d89be0c963e469a09aa7c9710b5cef503a176e /tests
parent024effd17ed96835a61474f0740e71dacec4f2af (diff)
parent644ad1a963ee3de3d5aba02b4afb0e9effd4b42d (diff)
Merge branch 'master' into feature/get-last-sql-query
Diffstat (limited to 'tests')
-rw-r--r--tests/test_prompt_utils.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_prompt_utils.py b/tests/test_prompt_utils.py
new file mode 100644
index 00000000..de676366
--- /dev/null
+++ b/tests/test_prompt_utils.py
@@ -0,0 +1,14 @@
+# -*- coding: utf-8 -*-
+
+
+import click
+
+from pgcli.packages.prompt_utils import confirm_destructive_query
+
+
+def test_confirm_destructive_query_notty():
+ stdin = click.get_text_stream('stdin')
+ assert stdin.isatty() is False
+
+ sql = 'drop database foo;'
+ assert confirm_destructive_query(sql) is None