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

Method test_anydbm_read

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

Source from the content-addressed store, hash-verified

97 f.close()
98
99 def test_anydbm_read(self):
100 self.init_db()
101 f = dbm.open(_fname, 'r')
102 self.read_helper(f)
103 # get() works as in the dict interface
104 self.assertEqual(f.get(b'a'), self._dict['a'])
105 self.assertEqual(f.get(b'xxx', b'foo'), b'foo')
106 self.assertIsNone(f.get(b'xxx'))
107 with self.assertRaises(KeyError):
108 f[b'xxx']
109 f.close()
110
111 def test_anydbm_keys(self):
112 self.init_db()

Callers

nothing calls this directly

Calls 8

init_dbMethod · 0.95
read_helperMethod · 0.95
assertIsNoneMethod · 0.80
openMethod · 0.45
assertEqualMethod · 0.45
getMethod · 0.45
assertRaisesMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected