summaryrefslogtreecommitdiffstats
path: root/test/test_prompt_utils.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 17:39:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 17:39:33 +0000
commit98aa4c820d8dd9e1090590242ab408c1221b0ba8 (patch)
tree70b027a809ee8f8fea766316f8d52f56b1dc6f32 /test/test_prompt_utils.py
parentInitial commit. (diff)
downloadmycli-98aa4c820d8dd9e1090590242ab408c1221b0ba8.tar.xz
mycli-98aa4c820d8dd9e1090590242ab408c1221b0ba8.zip
Adding upstream version 1.26.1.upstream/1.26.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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