Skip to content

Commit

Permalink
Also fix \dn.
Browse files Browse the repository at this point in the history
  • Loading branch information
j-bennet committed Jan 16, 2023
1 parent cfea093 commit 88c02d7
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions tests/test_specials.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

import pytest
from dbutils import dbtest, POSTGRES_USER, foreign_db_environ, fdw_test
from dbutils import dbtest, POSTGRES_USER, SERVER_VERSION, foreign_db_environ, fdw_test
import itertools

objects_listing_headers = ["Schema", "Name", "Type", "Owner", "Size", "Description"]
Expand Down Expand Up @@ -216,18 +216,25 @@ def test_slash_dn(executor):
"""List all schemas."""
results = executor(r"\dn")
title = None
rows = [
("public", POSTGRES_USER),
("schema1", POSTGRES_USER),
("schema2", POSTGRES_USER),
("schema3", POSTGRES_USER),
]
if SERVER_VERSION >= 150001:
rows = [
("public", 'pg_database_owner'),
("schema1", POSTGRES_USER),
("schema2", POSTGRES_USER),
("schema3", POSTGRES_USER),
]
else:
rows = [
("public", POSTGRES_USER),
("schema1", POSTGRES_USER),
("schema2", POSTGRES_USER),
("schema3", POSTGRES_USER),
]

headers = ["Name", "Owner"]
status = "SELECT %s" % len(rows)
assert results[0] == title
assert set(results[1]).issuperset(set(rows))
assert results[2] == headers
assert results[3] == status
expected = [title, rows, headers, status]
assert results == expected


@dbtest
Expand Down

0 comments on commit 88c02d7

Please sign in to comment.