1
0
Fork 0
pgcli/tests/test_prompt_utils.py
Daniel Baumann 7c65fc707e
Merging upstream version 4.0.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
2025-02-09 20:05:21 +01:00

17 lines
523 B
Python

import click
from pgcli.packages.prompt_utils import confirm_destructive_query
def test_confirm_destructive_query_notty():
stdin = click.get_text_stream("stdin")
if not stdin.isatty():
sql = "drop database foo;"
assert confirm_destructive_query(sql, [], None) is None
def test_confirm_destructive_query_with_alias():
stdin = click.get_text_stream("stdin")
if not stdin.isatty():
sql = "drop database foo;"
assert confirm_destructive_query(sql, ["drop"], "test") is None