home *** CD-ROM | disk | FTP | other *** search
/ Freelog 33 / Freelog033.iso / Progr / Python-2.2.1.exe / TEST_GRP.PY < prev    next >
Encoding:
Python Source  |  2001-09-20  |  569 b   |  28 lines

  1. """Test script for the grp module."""
  2.  
  3. # XXX This really needs some work, but what are the expected invariants?
  4.  
  5. import grp
  6. import test_support
  7. import unittest
  8.  
  9.  
  10. class GroupDatabaseTestCase(unittest.TestCase):
  11.  
  12.     def setUp(self):
  13.         self.groups = grp.getgrall()
  14.  
  15.     def test_getgrgid(self):
  16.         entry = grp.getgrgid(self.groups[0][2])
  17.  
  18.     def test_getgrnam(self):
  19.         entry = grp.getgrnam(self.groups[0][0])
  20.  
  21.  
  22. def test_main():
  23.     test_support.run_unittest(GroupDatabaseTestCase)
  24.  
  25.  
  26. if __name__ == "__main__":
  27.     test_main()
  28.