| from test import test_support |
| nis = test_support.import_module('nis') |
| class NisTests(unittest.TestCase): |
| # NIS is probably not active, so this test isn't useful |
| print "Test Skipped:", msg |
| # Can't raise SkipTest as regrtest only recognizes the exception |
| # On some systems, this map is only accessible to the |
| maps.remove("passwd.adjunct.byname") |
| mapping = nis.cat(nismap) |
| for k, v in mapping.items(): |
| if nis.match(k, nismap) != v: |
| self.fail("NIS match failed for key `%s' in map `%s'" % (k, nismap)) |
| # just test the one key, otherwise this test could take a |
| test_support.run_unittest(NisTests) |
| if __name__ == '__main__': |