Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

testROT.py 762B

1 year ago
1234567891011121314151617181920212223242526272829
  1. import unittest
  2. import pythoncom
  3. import win32com.test.util
  4. import winerror
  5. class TestROT(win32com.test.util.TestCase):
  6. def testit(self):
  7. ctx = pythoncom.CreateBindCtx()
  8. rot = pythoncom.GetRunningObjectTable()
  9. num = 0
  10. for mk in rot:
  11. name = mk.GetDisplayName(ctx, None)
  12. num += 1
  13. # Monikers themselves can iterate their contents (sometimes :)
  14. try:
  15. for sub in mk:
  16. num += 1
  17. except pythoncom.com_error as exc:
  18. if exc.hresult != winerror.E_NOTIMPL:
  19. raise
  20. # if num < 2:
  21. # print "Only", num, "objects in the ROT - this is unusual"
  22. if __name__ == "__main__":
  23. unittest.main()