summaryrefslogtreecommitdiffstats
path: root/tests/test_prompt_utils.py
blob: 7fb7482e26f6a629bfa4e89498b7fc8fc0975f77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# -*- 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')
    if not stdin.isatty():
        sql = 'drop database foo;'
        assert confirm_destructive_query(sql) is None