def METHOD_NAME(self):
    with gdbm.open(filename, 'c') as db:
        db["gdbm context manager"] = "context manager"
    with gdbm.open(filename, 'r') as db:
        self.assertEqual(list(db.keys()), [b"gdbm context manager"])
    with self.assertRaises(gdbm.error) as cm:
        db.keys()
    self.assertEqual(str(cm.exception),
                     "GDBM object has already been closed")