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

Method test_str_write_contains

Lib/test/test_dbm_dumb.py:122–131  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

120 self.assertEqual(f['\u00fc'], self._dict['\u00fc'.encode('utf-8')])
121
122 def test_str_write_contains(self):
123 self.init_db()
124 with contextlib.closing(dumbdbm.open(_fname)) as f:
125 f['\u00fc'] = b'!'
126 f['1'] = 'a'
127 with contextlib.closing(dumbdbm.open(_fname, 'r')) as f:
128 self.assertIn('\u00fc', f)
129 self.assertEqual(f['\u00fc'.encode('utf-8')],
130 self._dict['\u00fc'.encode('utf-8')])
131 self.assertEqual(f[b'1'], b'a')
132
133 def test_line_endings(self):
134 # test for bug #1172763: dumbdbm would die if the line endings

Callers

nothing calls this directly

Calls 6

init_dbMethod · 0.95
closingMethod · 0.80
assertInMethod · 0.80
openMethod · 0.45
assertEqualMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected