summaryrefslogtreecommitdiffstats
path: root/tests/test_pgspecial.py
diff options
context:
space:
mode:
authorDarik Gamble <darik.gamble@gmail.com>2015-05-22 18:06:49 -0400
committerDarik Gamble <darik.gamble@gmail.com>2015-05-23 08:33:42 -0400
commit9e621ba97c7981647c5b3e984f6132b107f3822f (patch)
treea909cbefa04ecc6ba163952ffb0e3fb2225a5af7 /tests/test_pgspecial.py
parent128264057e58904c8023998fc4eec8752807cede (diff)
Support \dT to list datatypes
Diffstat (limited to 'tests/test_pgspecial.py')
-rw-r--r--tests/test_pgspecial.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_pgspecial.py b/tests/test_pgspecial.py
index 7b76d5e0..f08fd304 100644
--- a/tests/test_pgspecial.py
+++ b/tests/test_pgspecial.py
@@ -53,3 +53,18 @@ def test_leading_whitespace_ok():
whitespace = ' '
suggestions = suggest_type(whitespace + cmd, whitespace + cmd)
assert suggestions == suggest_type(cmd, cmd)
+
+
+def test_dT_suggests_schema_or_datatypes():
+ text = '\\dT '
+ suggestions = suggest_type(text, text)
+ assert sorted_dicts(suggestions) == sorted_dicts(
+ [{'type': 'schema'},
+ {'type': 'datatype', 'schema': []},
+ ])
+
+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