Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a8b3188

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

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

‎asyncpg/pgproto

‎tests/test_connect.py

Lines changed: 9 additions & 0 deletions
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ドル::text", 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)

AltStyle によって変換されたページ (->オリジナル) /