Issue #18039: dbm.dump.open() now always creates a new database when the

flag has the value 'n'.  Patch by Claudiu Popa.
This commit is contained in:
Serhiy Storchaka 2014-06-10 21:16:00 +03:00
parent 4c4cde7829
commit b398d33c65
4 changed files with 36 additions and 11 deletions

View file

@ -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()