summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dbm.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-05-26 10:29:35 (GMT)
committerGeorg Brandl <georg@python.org>2008-05-26 10:29:35 (GMT)
commit0a7ac7d70d370544c6a9d118bbbd6886ad4f5ce5 (patch)
treeec61fd6d53e6425b8639567860140c724ea7bc63 /Lib/test/test_dbm.py
parente6f00637be87c8f5f0e50bf317d684ea421a6d19 (diff)
downloadcpython-0a7ac7d70d370544c6a9d118bbbd6886ad4f5ce5.zip
cpython-0a7ac7d70d370544c6a9d118bbbd6886ad4f5ce5.tar.gz
cpython-0a7ac7d70d370544c6a9d118bbbd6886ad4f5ce5.tar.bz2
Create the dbm package from PEP 3108. #2881.
Diffstat (limited to 'Lib/test/test_dbm.py')
-rwxr-xr-xLib/test/test_dbm.py40
1 files changed, 0 insertions, 40 deletions
diff --git a/Lib/test/test_dbm.py b/Lib/test/test_dbm.py
deleted file mode 100755
index 2c6ce99..0000000
--- a/Lib/test/test_dbm.py
+++ /dev/null
@@ -1,40 +0,0 @@
-from test import support
-import unittest
-import os
-import random
-import dbm
-from dbm import error
-
-class DbmTestCase(unittest.TestCase):
-
- def setUp(self):
- self.filename = support.TESTFN
- self.d = dbm.open(self.filename, 'c')
- self.d.close()
-
- def tearDown(self):
- for suffix in ['', '.pag', '.dir', '.db']:
- support.unlink(self.filename + suffix)
-
- def test_keys(self):
- self.d = dbm.open(self.filename, 'c')
- self.assert_(self.d.keys() == [])
- self.d['a'] = 'b'
- self.d['12345678910'] = '019237410982340912840198242'
- self.d.keys()
- self.assert_(b'a' in self.d)
- self.d.close()
-
- def test_modes(self):
- for mode in ['r', 'rw', 'w', 'n']:
- try:
- self.d = dbm.open(self.filename, mode)
- self.d.close()
- except dbm.error:
- self.fail()
-
-def test_main():
- support.run_unittest(DbmTestCase)
-
-if __name__ == '__main__':
- test_main()