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

Method test_bytes

Lib/test/test_dbm_ndbm.py:74–80  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

72 "DBM object has already been closed")
73
74 def test_bytes(self):
75 with dbm.ndbm.open(self.filename, 'c') as db:
76 db[b'bytes key \xbd'] = b'bytes value \xbd'
77 with dbm.ndbm.open(self.filename, 'r') as db:
78 self.assertEqual(list(db.keys()), [b'bytes key \xbd'])
79 self.assertTrue(b'bytes key \xbd' in db)
80 self.assertEqual(db[b'bytes key \xbd'], b'bytes value \xbd')
81
82 def test_unicode(self):
83 with dbm.ndbm.open(self.filename, 'c') as db:

Callers

nothing calls this directly

Calls 5

listClass · 0.85
assertTrueMethod · 0.80
openMethod · 0.45
assertEqualMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected