MCPcopy Index your code
hub / github.com/python/cpython / test_anydbm_modification

Method test_anydbm_modification

Lib/test/test_dbm.py:88–96  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

86 self.assertEqual(len(f), 0)
87
88 def test_anydbm_modification(self):
89 self.init_db()
90 f = dbm.open(_fname, 'c')
91 self._dict['g'] = f[b'g'] = b"indented"
92 self.read_helper(f)
93 # setdefault() works as in the dict interface
94 self.assertEqual(f.setdefault(b'xxx', b'foo'), b'foo')
95 self.assertEqual(f[b'xxx'], b'foo')
96 f.close()
97
98 def test_anydbm_read(self):
99 self.init_db()

Callers

nothing calls this directly

Calls 6

init_dbMethod · 0.95
read_helperMethod · 0.95
openMethod · 0.45
assertEqualMethod · 0.45
setdefaultMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected