MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_anydbm_modification

Method test_anydbm_modification

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

Source from the content-addressed store, hash-verified

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