summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dbm_dumb.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-06-10 18:16:00 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-06-10 18:16:00 (GMT)
commitb398d33c65636aed68246179a4f6ae4b3fbcf182 (patch)
treefb373ad7783e72cc5a0454e0907afc4de370129f /Lib/test/test_dbm_dumb.py
parent4c4cde7829211bd565e4a045d4d9bda39cf9dab7 (diff)
downloadcpython-b398d33c65636aed68246179a4f6ae4b3fbcf182.zip
cpython-b398d33c65636aed68246179a4f6ae4b3fbcf182.tar.gz
cpython-b398d33c65636aed68246179a4f6ae4b3fbcf182.tar.bz2
Issue #18039: dbm.dump.open() now always creates a new database when the
flag has the value 'n'. Patch by Claudiu Popa.
Diffstat (limited to 'Lib/test/test_dbm_dumb.py')
-rw-r--r--Lib/test/test_dbm_dumb.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_dbm_dumb.py b/Lib/test/test_dbm_dumb.py
index 29f48a3..ee5a32f 100644
--- a/Lib/test/test_dbm_dumb.py
+++ b/Lib/test/test_dbm_dumb.py
@@ -217,6 +217,14 @@ class DumbDBMTestCase(unittest.TestCase):
self.assertEqual(str(cm.exception),
"DBM object has already been closed")
+ def test_create_new(self):
+ with dumbdbm.open(_fname, 'n') as f:
+ for k in self._dict:
+ f[k] = self._dict[k]
+
+ with dumbdbm.open(_fname, 'n') as f:
+ self.assertEqual(f.keys(), [])
+
def tearDown(self):
_delete_files()