Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-43853: Expand test suite for SQLite UDF's #27642

Merged
merged 16 commits into from
Jan 26, 2022
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
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
@@ -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),
@@ -340,6 +344,7 @@ def test_func_params(self):
(float('inf'), float),
("text", str),
erlend-aasland marked this conversation as resolved.
Show resolved Hide resolved
("1\x002", str),
("\u02e2q\u02e1\u2071\u1d57\u1d49", str),
(b"blob", bytes),
erlend-aasland marked this conversation as resolved.
Show resolved Hide resolved
(bytearray(range(2)), bytes),
erlend-aasland marked this conversation as resolved.
Show resolved Hide resolved
(memoryview(b"blob"), bytes),