Fred Drake | 5b811be | 2001-05-18 21:38:52 +0000 | [diff] [blame] | 1 | """Test script for the grp module.""" |
| 2 | |
| 3 | # XXX This really needs some work, but what are the expected invariants? |
Fred Drake | 004d5e6 | 2000-10-23 17:22:08 +0000 | [diff] [blame] | 4 | |
Roger E. Masse | 749cc6b | 1996-12-18 19:36:34 +0000 | [diff] [blame] | 5 | import grp |
Fred Drake | 5b811be | 2001-05-18 21:38:52 +0000 | [diff] [blame] | 6 | import test_support |
| 7 | import unittest |
Roger E. Masse | 749cc6b | 1996-12-18 19:36:34 +0000 | [diff] [blame] | 8 | |
Roger E. Masse | 749cc6b | 1996-12-18 19:36:34 +0000 | [diff] [blame] | 9 | |
Fred Drake | 5b811be | 2001-05-18 21:38:52 +0000 | [diff] [blame] | 10 | class GroupDatabaseTestCase(unittest.TestCase): |
Roger E. Masse | 749cc6b | 1996-12-18 19:36:34 +0000 | [diff] [blame] | 11 | |
Fred Drake | 5b811be | 2001-05-18 21:38:52 +0000 | [diff] [blame] | 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 | test_support.run_unittest(GroupDatabaseTestCase) |