def METHOD_NAME(self):
    with gdbm.open(filename, 'c') as db:
        db[b'bytes key \xbd'] = b'bytes value \xbd'
    with gdbm.open(filename, 'r') as db:
        self.assertEqual(list(db.keys()), [b'bytes key \xbd'])
        self.assertTrue(b'bytes key \xbd' in db)
        self.assertEqual(db[b'bytes key \xbd'], b'bytes value \xbd')