[pywin32-checkins] pywin32/win32/test test_win32rcparser.py, 1.2, 1.3
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2008-07-04 01:55:06
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5386/test Modified Files: test_win32rcparser.py Log Message: Fix [ 1953828 ] win32rcparser: stringTable error in GenerateFrozenResource >From Hugh Emberson Index: test_win32rcparser.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32rcparser.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_win32rcparser.py 26 May 2004 08:27:48 -0000 1.2 --- test_win32rcparser.py 4 Jul 2008 01:55:13 -0000 1.3 *************** *** 3,6 **** --- 3,7 ---- import win32rcparser import win32con + import tempfile class TestParser(unittest.TestCase): *************** *** 45,48 **** --- 46,66 ---- self.failUnlessEqual(num_ok, len(tabstop_ids) + len(notabstop_ids)) + class TestGenerated(TestParser): + def setUp(self): + # don't call base! + rc_file = os.path.join(os.path.dirname(__file__), "win32rcparser", "test.rc") + py_file = tempfile.mktemp('test_win32rcparser.py') + try: + win32rcparser.GenerateFrozenResource(rc_file, py_file) + py_source = open(py_file).read() + finally: + if os.path.isfile(py_file): + os.unlink(py_file) + + # poor-man's import :) + globs = {} + exec py_source in globs, globs + self.resources = globs["FakeParser"]() + if __name__=='__main__': unittest.main() |