def METHOD_NAME(self):
    with dbm.ndbm.open(self.filename, 'c') as db:
        db[b'bytes key'] = b'bytes value'
    with dbm.ndbm.open(self.filename, 'r') as db:
        with self.assertRaises(error):
            del db[b'not exist key']
        with self.assertRaises(error):
            del db[b'bytes key']
        with self.assertRaises(error):
            db[b'not exist key'] = b'not exist value'