[pywin32-checkins] pywin32/win32/test test_clipboard.py,NONE,1.1 test_security.py,NONE,1.1
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <mha...@us...> - 2003-09-02 00:16:27
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory sc8-pr-cvs1:/tmp/cvs-serv506 Added Files: test_clipboard.py test_security.py Log Message: Couple of new test cases. --- NEW FILE: test_clipboard.py --- # General test module for win32api - please add some :) import unittest import win32clipboard class CrashingTestCase(unittest.TestCase): def test_722082(self): class crasher(object): pass obj = crasher() win32clipboard.OpenClipboard() win32clipboard.EmptyClipboard() # This used to crash - now correctly raises type error. self.assertRaises(TypeError, win32clipboard.SetClipboardData, 0, obj ) if __name__ == '__main__': unittest.main() --- NEW FILE: test_security.py --- import win32api, win32con, win32security pwr_sid=win32security.LookupAccountName('','Power Users')[0] admin_sid=win32security.LookupAccountName('','Administrator')[0] sd=win32security.SECURITY_DESCRIPTOR() for x in xrange(0,100000): sd.SetSecurityDescriptorOwner(admin_sid,0) sd=win32security.SECURITY_DESCRIPTOR() for x in xrange(0,100000): sd.SetSecurityDescriptorGroup(pwr_sid,0) sd=win32security.SECURITY_DESCRIPTOR() dacl=win32security.ACL() dacl.AddAccessAllowedAce(win32security.ACL_REVISION,win32con.GENERIC_READ,pwr_sid) dacl.AddAccessAllowedAce(win32security.ACL_REVISION,win32con.GENERIC_ALL,admin_sid) for x in xrange(0,1000000): sd.SetSecurityDescriptorDacl(1,dacl,0) sd=win32security.SECURITY_DESCRIPTOR() sacl=win32security.ACL() sacl.AddAuditAccessAce(win32security.ACL_REVISION,win32con.DELETE,admin_sid,1,1) sacl.AddAuditAccessAce(win32security.ACL_REVISION,win32con.GENERIC_ALL,pwr_sid,1,1) for x in xrange(0,1000000): sd.SetSecurityDescriptorSacl(1,sacl,0) |