diff options
author | Karl-Aksel Puulmann <oxymaccy@gmail.com> | 2015-01-08 12:56:28 +0200 |
---|---|---|
committer | Amjith Ramanujam <amjith.r@gmail.com> | 2015-01-09 00:16:55 -0800 |
commit | 9632546c4b52362b21ddf9072c68f0b3411c6d1d (patch) | |
tree | 4026566b8055794b729f8409d7d276598d712007 /tests | |
parent | b7f9c00c21ab3bbcdfccd63a7fd9f844e363270f (diff) |
Do only one query for all columns, instead of len(tables) queries. Should fix #25
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_pgexecute.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_pgexecute.py b/tests/test_pgexecute.py index 3ae8b545..3160cc28 100644 --- a/tests/test_pgexecute.py +++ b/tests/test_pgexecute.py @@ -51,3 +51,18 @@ def test_conn(executor): | abc | +-----+ SELECT 1""") + +@dbtest +def test_table_and_columns_query(executor): + run(executor, "create table a(x text, y text)") + run(executor, "create table b(z text)") + + tables, columns = executor.tables() + assert tables == ['a', 'b'] + assert columns['a'] == ['x', 'y'] + assert columns['b'] == ['z'] + +@dbtest +def test_database_list(executor): + databases = executor.databases() + assert '_test_db' in databases |