test_win32net.py 629 B

123456789101112131415161718192021
  1. import unittest
  2. import win32net, win32netcon
  3. class TestCase(unittest.TestCase):
  4. def testGroupsGoodResume(self, server=None):
  5. res=0
  6. level=0 #setting it to 1 will provide more detailed info
  7. while True:
  8. (user_list,total,res)=win32net.NetGroupEnum(server,level,res)
  9. for i in user_list:
  10. pass
  11. if not res:
  12. break
  13. def testGroupsBadResume(self, server=None):
  14. res=1 # Can't pass this first time round.
  15. self.assertRaises(win32net.error, win32net.NetGroupEnum, server,0,res)
  16. if __name__ == '__main__':
  17. unittest.main()