diff options
author | Amjith Ramanujam <amjith.r@gmail.com> | 2015-01-30 18:15:40 -0800 |
---|---|---|
committer | Amjith Ramanujam <amjith.r@gmail.com> | 2015-01-30 18:15:40 -0800 |
commit | cf0f33ff01a9f84b621420a070ad5dc9f922a972 (patch) | |
tree | c5eeb902d3c76d0b18bc078aa654d9cd3790a50d | |
parent | 3d501471c88216591f8914e98477022098f90952 (diff) |
Add a test for the unicode handling in unknown types.
-rw-r--r-- | tests/test_pgexecute.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/test_pgexecute.py b/tests/test_pgexecute.py index 37815766..d8a8a5c0 100644 --- a/tests/test_pgexecute.py +++ b/tests/test_pgexecute.py @@ -1,7 +1,9 @@ # coding=UTF-8 +import pytest +import psycopg2 from textwrap import dedent -from utils import * +from utils import run, dbtest @dbtest def test_conn(executor): @@ -69,7 +71,7 @@ def test_unicode_support_in_output(executor, expanded): @dbtest def test_multiple_queries_same_line(executor): result = run(executor, "select 'foo'; select 'bar'") - assert len(result) == 4 # 2 * (output+status) + assert len(result) == 4 # 2 * (output+status) assert "foo" in result[0] assert "bar" in result[2] @@ -91,3 +93,7 @@ def test_bytea_field_support_in_output(executor): "insert into binarydata (c) values (decode('DEADBEEF', 'hex'))") assert u'\\xdeadbeef' in run(executor, "select * from binarydata", join=True) + +@dbtest +def test_unicode_support_in_unknown_type(executor): + assert u'日本語' in run(executor, "SELECT '日本語' AS japanese;", join=True) |