diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-06-10 18:16:00 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-06-10 18:16:00 (GMT) |
commit | b398d33c65636aed68246179a4f6ae4b3fbcf182 (patch) | |
tree | fb373ad7783e72cc5a0454e0907afc4de370129f /Lib/test | |
parent | 4c4cde7829211bd565e4a045d4d9bda39cf9dab7 (diff) | |
download | cpython-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')
-rw-r--r-- | Lib/test/test_dbm_dumb.py | 8 |
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() |