Skip to content

Commit

Permalink
Update pgproto and add tests for client_encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
fantix committed Feb 1, 2023
1 parent 7df9812 commit a8b3188
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion asyncpg/pgproto
Submodule pgproto updated 4 files
+1 −1 .gitignore
+2 −2 codecs/text.pyx
+3 −1 types.py
+24 −10 uuid.pyx
9 changes: 9 additions & 0 deletions tests/test_connect.py
Expand Up @@ -77,6 +77,15 @@ async def test_get_settings_01(self):
self.assertEqual(
self.con.get_settings().client_encoding,
'UTF8')
await self.con.execute("set client_encoding to 'sql-ascii'")
self.assertEqual(self.con.get_settings().client_encoding, "SQL_ASCII")

async def test_client_encoding(self):
await self.con.execute("set client_encoding to 'sql-ascii'")
encoding = await self.con.fetchval("show client_encoding")
self.assertEqual(encoding, "SQL_ASCII")
encoding = await self.con.fetchval("select $1::text", encoding)
self.assertEqual(encoding, "SQL_ASCII")

async def test_server_version_01(self):
version = self.con.get_server_version()
Expand Down

0 comments on commit a8b3188

Please sign in to comment.