mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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:
parent
4c4cde7829
commit
b398d33c65
4 changed files with 36 additions and 11 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue