diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2020-06-25 08:37:12 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-25 08:37:12 (GMT) |
commit | 55939b1708d6fc0d36d2be11ccdc6bf207e1bd41 (patch) | |
tree | cdfce605a8dbd54923f85fb9078d882dcc89d3b3 /Lib/test/test_msilib.py | |
parent | 152f0b8beea12e6282d284100b600771b968927a (diff) | |
download | cpython-55939b1708d6fc0d36d2be11ccdc6bf207e1bd41.zip cpython-55939b1708d6fc0d36d2be11ccdc6bf207e1bd41.tar.gz cpython-55939b1708d6fc0d36d2be11ccdc6bf207e1bd41.tar.bz2 |
bpo-41074: Fix support of non-ASCII names and SQL in msilib. (GH-21126)
* Fix support of non-ASCII names in functions OpenDatabase()
and init_database().
* Fix support of non-ASCII SQL in method Database.OpenView().
Diffstat (limited to 'Lib/test/test_msilib.py')
-rw-r--r-- | Lib/test/test_msilib.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Lib/test/test_msilib.py b/Lib/test/test_msilib.py index f9bd0da..153a8ac 100644 --- a/Lib/test/test_msilib.py +++ b/Lib/test/test_msilib.py @@ -1,13 +1,13 @@ """ Test suite for the code in msilib """ import os import unittest -from test.support import TESTFN, import_module, unlink +from test.support import TESTFN, FS_NONASCII, import_module, unlink msilib = import_module('msilib') import msilib.schema def init_database(): - path = TESTFN + '.msi' + path = TESTFN + (FS_NONASCII or '') + '.msi' db = msilib.init_database( path, msilib.schema, @@ -42,6 +42,16 @@ class MsiDatabaseTestCase(unittest.TestCase): ) self.addCleanup(unlink, db_path) + def test_view_non_ascii(self): + db, db_path = init_database() + view = db.OpenView("SELECT 'ß-розпад' FROM Property") + view.Execute(None) + record = view.Fetch() + self.assertEqual(record.GetString(1), 'ß-розпад') + view.Close() + db.Close() + self.addCleanup(unlink, db_path) + def test_summaryinfo_getproperty_issue1104(self): db, db_path = init_database() try: |