diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2020-03-11 10:50:56 +1300 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2020-03-11 10:50:56 +1300 |
commit | 054123254e49ee5edeb35a2d648fce52755f5afe (patch) | |
tree | 3d1c95c35e05905a6f0f747072107a84dfbdbb66 /tests/test_cursor.py | |
parent | 5d96b0c02419fb2fd0c8fdee7dad0a5d5f4ac1a9 (diff) | |
download | psycopg2-column-slice.tar.gz |
Column objects can be slicedcolumn-slice
Close #1034.
Diffstat (limited to 'tests/test_cursor.py')
-rwxr-xr-x | tests/test_cursor.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_cursor.py b/tests/test_cursor.py index 4d18096..9bf9ccf 100755 --- a/tests/test_cursor.py +++ b/tests/test_cursor.py @@ -433,6 +433,11 @@ class CursorTests(ConnectingTestCase): self.assertEqual(curs.description[2].table_oid, None) self.assertEqual(curs.description[2].table_column, None) + def test_description_slice(self): + curs = self.conn.cursor() + curs.execute("select 1::int as a") + self.assertEqual(curs.description[0][0:2], ('a', 23)) + def test_pickle_description(self): curs = self.conn.cursor() curs.execute('SELECT 1 AS foo') |