summaryrefslogtreecommitdiff
path: root/Lib/test/test_nis.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1996-12-11 01:01:38 +0000
committerBarry Warsaw <barry@python.org>1996-12-11 01:01:38 +0000
commit142ec5bdca99d11236f2d479cf4dafbc7e8962a3 (patch)
treef754c91040500cdcf8831d63f5babfa74585afc9 /Lib/test/test_nis.py
parentd791fc9b5ee09c6c163fd38b38850f2e16523ecf (diff)
downloadcpython-142ec5bdca99d11236f2d479cf4dafbc7e8962a3.tar.gz
test of the nis module
Diffstat (limited to 'Lib/test/test_nis.py')
-rw-r--r--Lib/test/test_nis.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/Lib/test/test_nis.py b/Lib/test/test_nis.py
new file mode 100644
index 0000000000..182a2e21af
--- /dev/null
+++ b/Lib/test/test_nis.py
@@ -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)
+