diff options
author | Darik Gamble <darik.gamble@gmail.com> | 2015-08-05 14:32:35 -0400 |
---|---|---|
committer | Darik Gamble <darik.gamble@gmail.com> | 2015-08-05 14:32:35 -0400 |
commit | 6a2771a9a2d67fff33291c15197ab56c3cf9fc5d (patch) | |
tree | 167300145dddb48227db3fe839462791b9a26a8c /tests/test_pgspecial.py | |
parent | 100daebaaea112036f6f89c70d8f37ac17c18b2e (diff) |
Add tests for \c and \connect to suggest databases
Diffstat (limited to 'tests/test_pgspecial.py')
-rw-r--r-- | tests/test_pgspecial.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/test_pgspecial.py b/tests/test_pgspecial.py index f08fd304..fc41ad58 100644 --- a/tests/test_pgspecial.py +++ b/tests/test_pgspecial.py @@ -1,3 +1,4 @@ +import pytest from pgcli.packages.sqlcompletion import suggest_type from test_sqlcompletion import sorted_dicts @@ -67,4 +68,10 @@ def test_schema_qualified_dT_suggests_datatypes(): text = '\\dT foo.' suggestions = suggest_type(text, text) assert sorted_dicts(suggestions) == sorted_dicts( - [{'type': 'datatype', 'schema': 'foo'}])
\ No newline at end of file + [{'type': 'datatype', 'schema': 'foo'}]) + + +@pytest.mark.parametrize('command', ['\\c ', '\\connect ']) +def test_c_suggests_databases(command): + suggestions = suggest_type(command, command) + assert suggestions == [{'type': 'database'}]
\ No newline at end of file |