]> granicus.if.org Git - python/commitdiff
test of the nis module
authorBarry Warsaw <barry@python.org>
Wed, 11 Dec 1996 01:01:38 +0000 (01:01 +0000)
committerBarry Warsaw <barry@python.org>
Wed, 11 Dec 1996 01:01:38 +0000 (01:01 +0000)
Lib/test/test_nis.py [new file with mode: 0644]

diff --git a/Lib/test/test_nis.py b/Lib/test/test_nis.py
new file mode 100644 (file)
index 0000000..182a2e2
--- /dev/null
@@ -0,0 +1,19 @@
+import nis
+
+verbose = 0
+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():
+       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)
+