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