summaryrefslogtreecommitdiff
path: root/Lib/test/test_nis.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1996-12-11 16:07:30 +0000
committerBarry Warsaw <barry@python.org>1996-12-11 16:07:30 +0000
commit4763594f909dae85840b56890f35a4fe55484eaf (patch)
treed21a9c00fdabded12df99e9d3e8d21c74562c742 /Lib/test/test_nis.py
parent142ec5bdca99d11236f2d479cf4dafbc7e8962a3 (diff)
downloadcpython-4763594f909dae85840b56890f35a4fe55484eaf.tar.gz
Just test one key/value pair for one NIS map. I.e. don't test them
all because it can take a really long time.
Diffstat (limited to 'Lib/test/test_nis.py')
-rw-r--r--Lib/test/test_nis.py28
1 files changed, 17 insertions, 11 deletions
diff --git a/Lib/test/test_nis.py b/Lib/test/test_nis.py
index 182a2e21af..2afe111732 100644
--- a/Lib/test/test_nis.py
+++ b/Lib/test/test_nis.py
@@ -5,15 +5,21 @@ if __name__ == '__main__':
verbose = 1
maps = nis.maps()
-for nismap in maps:
- if verbose:
- print nismap
- mapping = nis.cat(nismap)
- for k, v in mapping.items():
+try:
+ for nismap in maps:
if verbose:
- print ' ', k, v
- if not k:
- continue
- if nis.match(k, nismap) <> v:
- print "NIS match failed for key `%s' in map `%s'" % (k, nismap)
-
+ print nismap
+ mapping = nis.cat(nismap)
+ for k, v in mapping.items():
+ if verbose:
+ print ' ', k, v
+ if not k:
+ continue
+ if nis.match(k, nismap) <> v:
+ print "NIS match failed for key `%s' in map `%s'" % (k, nismap)
+ else:
+ # just test the one key, otherwise this test could take a
+ # very long time
+ raise 'done'
+except 'done':
+ pass