summaryrefslogtreecommitdiffstats
path: root/test/test_prompt_utils.py
blob: 2373fac82f62c49c0221a3547b1033bd1af20e86 (plain)
1
2
3
4
5
6
7
8
9
10
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