Skip to content

Commit 670b7b4

Browse files
committed
Update pgproto and add tests for client_encoding
Depends on MagicStack/py-pgproto#20
1 parent 7df9812 commit 670b7b4

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

tests/test_connect.py

+9
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ async def test_get_settings_01(self):
7777
self.assertEqual(
7878
self.con.get_settings().client_encoding,
7979
'UTF8')
80+
await self.con.execute("set client_encoding to 'sql-ascii'")
81+
self.assertEqual(self.con.get_settings().client_encoding, "SQL_ASCII")
82+
83+
async def test_client_encoding(self):
84+
await self.con.execute("set client_encoding to 'sql-ascii'")
85+
encoding = await self.con.fetchval("show client_encoding")
86+
self.assertEqual(encoding, "SQL_ASCII")
87+
encoding = await self.con.fetchval("select $1", encoding)
88+
self.assertEqual(encoding, "SQL_ASCII")
8089

8190
async def test_server_version_01(self):
8291
version = self.con.get_server_version()

0 commit comments

Comments
 (0)