Visitar URL original
bpo-43853: Expand test suite for SQLite UDF's by erlend-aasland · Pull Request #27642 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Test surrogates and non-ascii chars
  • Loading branch information
Erlend E. Aasland
Erlend E. Aasland committed Aug 12, 2021
commit 05c2f807097c98f2e901e140d9bbc40bbb5c59f9
11 changes: 8 additions & 3 deletions Lib/sqlite3/test/userfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,15 @@ def test_too_large_int(self):
"select spam(?)", (1 << 65,))

def test_non_contiguous_blob(self):
err = "could not convert BLOB to buffer"
self.assertRaisesRegex(ValueError, err, self.con.execute,
"select boomerang(?)",
self.assertRaisesRegex(ValueError, "could not convert BLOB to buffer",
self.con.execute, "select boomerang(?)",
(memoryview(b"blob")[::2],))

def test_param_surrogates(self):
self.assertRaisesRegex(UnicodeEncodeError, "surrogates not allowed",
self.con.execute, "select spam(?)",
("\ud803\ude6d",))

def test_func_params(self):
dataset = (
(42, int),
Expand All @@ -340,6 +344,7 @@ def test_func_params(self):
(float('inf'), float),
("text", str),
Comment thread
erlend-aasland marked this conversation as resolved.
("1\x002", str),
("\u02e2q\u02e1\u2071\u1d57\u1d49", str),
(b"blob", bytes),
Comment thread
erlend-aasland marked this conversation as resolved.
(bytearray(range(2)), bytes),
Comment thread
erlend-aasland marked this conversation as resolved.
(memoryview(b"blob"), bytes),
Expand Down