diff -r 596adf14914c Lib/test/test_msilib.py --- a/Lib/test/test_msilib.py Sat Jun 11 23:04:35 2011 +0100 +++ b/Lib/test/test_msilib.py Sun Jun 12 09:19:36 2011 +0800 @@ -3,6 +3,26 @@ import os from test.support import run_unittest, import_module msilib = import_module('msilib') +from test import support +import datetime + +msilib = support.import_module('msilib') +import msilib.schema + + +LAST_PRINTED_DATE = datetime.datetime(2011, 5, 30, 10, 55, 56) + +def create_temp_db(): + "Create a very simple database to open" + path = support.TESTFN + ".msi" + db = msilib.init_database( + path, msilib.schema, "Python Tests", "product_code", "1.0", "PSF") + db.Commit() + db = None + return path + +TEST_DB_PATH = create_temp_db() + class Test_make_id(unittest.TestCase): #http://msdn.microsoft.com/en-us/library/aa369212(v=vs.85).aspx @@ -39,8 +59,20 @@ msilib.make_id(".s\x82o?*+rt"), "_.s_o___rt") +class TestSummaryInformation(unittest.TestCase): + + def tearDown(self): + self.db = None + + def test_get_property_vt_empty(self): + self.db = msilib.OpenDatabase(TEST_DB_PATH, msilib.MSIDBOPEN_READONLY) + si = self.db.GetSummaryInformation(0) + self.assertEqual(si.GetProperty(msilib.PID_SECURITY), None) + + def test_main(): - run_unittest(__name__) + support.run_unittest(__name__) + os.unlink(TEST_DB_PATH) if __name__ == '__main__': test_main() diff -r 596adf14914c PC/_msi.c --- a/PC/_msi.c Sat Jun 11 23:04:35 2011 +0100 +++ b/PC/_msi.c Sun Jun 12 09:19:36 2011 +0800 @@ -558,6 +558,9 @@ if (sval != sbuf) free(sval); return result; + case VT_EMPTY: + Py_INCREF(Py_None); + return Py_None; } PyErr_Format(PyExc_NotImplementedError, "result of type %d", type); return NULL;