Skip to content

Commit de1e7fe

Browse files
committed
move is_dropping_database tests to parseutils.
1 parent be46108 commit de1e7fe

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

test/test_main.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import click
44
from click.testing import CliRunner
55

6-
from mycli.main import MyCli, cli, thanks_picker, is_dropping_database, PACKAGE_ROOT
6+
from mycli.main import MyCli, cli, thanks_picker, PACKAGE_ROOT
77
from mycli.packages.special.main import COMMANDS as SPECIAL_COMMANDS
88
from .utils import USER, HOST, PORT, PASSWORD, dbtest, run
99

@@ -147,17 +147,6 @@ def test_thanks_picker_utf8():
147147
assert name and isinstance(name, str)
148148

149149

150-
def test_is_dropping_database():
151-
is_dropping_text = "DROP DATABASE foo;"
152-
assert is_dropping_database(is_dropping_text, 'foo')
153-
is_not_dropping_text = "DROP DATABASE foo; CREATE DATABASE foo;"
154-
assert not is_dropping_database(is_not_dropping_text, 'foo')
155-
is_dropping_other_text = "DROP DATABASE bar;"
156-
assert not is_dropping_database(is_dropping_other_text, 'foo')
157-
is_not_dropping_other_text = "DROP DATABASE foo; CREATE DATABASE bar;"
158-
assert is_dropping_database(is_not_dropping_other_text, 'foo')
159-
160-
161150
def test_help_strings_end_with_periods():
162151
"""Make sure click options have help text that end with a period."""
163152
for param in cli.params:

test/test_parseutils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ def test_query_has_where_clause(sql, has_where_clause):
175175
('drop schema foo', 'bar', False),
176176
('drop database bar', 'foo', False),
177177
('drop database foo', None, False),
178+
('drop database foo; create database foo', 'foo', False),
179+
('drop database foo; create database bar', 'foo', True),
178180
('select bar from foo; drop database bazz', 'foo', False),
179181
('select bar from foo; drop database bazz', 'bazz', True),
180182
('-- dropping database \n '

0 commit comments

Comments
 (0)