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
commit3236b334efbb0b2245ce1a32a755e7f45ff69c2b (patch)
tree88fe8e81b73884964d99d7ba48793d8d03dd335b /Lib/test/test_nis.py
parent7822681992035b78afc1dd6b61dcce423a4129af (diff)
downloadcpython-git-3236b334efbb0b2245ce1a32a755e7f45ff69c2b.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)
+