summaryrefslogtreecommitdiffstats
path: root/test/test_prompt_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_prompt_utils.py')
-rw-r--r--test/test_prompt_utils.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_prompt_utils.py b/test/test_prompt_utils.py
new file mode 100644
index 0000000..2373fac
--- /dev/null
+++ b/test/test_prompt_utils.py
@@ -0,0 +1,11 @@
+import click
+
+from mycli.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