def METHOD_NAME(self):
    filename = support.TESTFN_NONASCII
    for suffix in ['', '.pag', '.dir', '.db']:
        self.addCleanup(support.unlink, filename + suffix)
    with dbm.ndbm.open(filename, 'c') as db:
        db[b'key'] = b'value'
    self.assertTrue(any(os.path.exists(filename + suffix)
                        for suffix in ['', '.pag', '.dir', '.db']))
    with dbm.ndbm.open(filename, 'r') as db:
        self.assertEqual(list(db.keys()), [b'key'])
        self.assertTrue(b'key' in db)
        self.assertEqual(db[b'key'], b'value')