def test_mode_subdir_nocreate(self): oldmask = os.umask(0) try: for mode in OCT('777'), OCT('755'), OCT('700'): path = testlib.temp_dir() env = lmdb.open(path, subdir=True, create=False, mode=mode) fmode = mode & ~OCT('111') assert testlib.path_mode(path + '/data.mdb') == fmode assert testlib.path_mode(path + '/lock.mdb') == fmode finally: os.umask(oldmask)
def test_mode_subdir_nocreate(self): if sys.platform == 'win32': # Mode argument is ignored on Windows; see lmdb.h return oldmask = os.umask(0) try: for mode in OCT('777'), OCT('755'), OCT('700'): path = testlib.temp_dir() env = lmdb.open(path, subdir=True, create=False, mode=mode) fmode = mode & ~OCT('111') assert testlib.path_mode(path + '/data.mdb') == fmode assert testlib.path_mode(path + '/lock.mdb') == fmode finally: os.umask(oldmask)