PyXR

c:\python24\lib\site-packages\win32 \ com \ test \ testWMI.py



0001 from win32com.client import GetObject
0002 import win32com.test.util
0003 
0004 import unittest
0005 
0006 class Simple(win32com.test.util.TestCase):
0007     def testit(self):
0008         cses = GetObject("WinMgMts:").InstancesOf("Win32_Process")
0009         vals = []
0010         for cs in cses:
0011             val = cs.Properties_("Caption").Value
0012             vals.append(val)
0013         self.failIf(len(vals)<5, "We only found %d processes!" % len(vals))
0014 
0015 if __name__=='__main__':
0016     unittest.main()
0017 
0018 

Generated by PyXR 0.9.4
SourceForge.net Logo