def test_join(self): self.assertEqual(os.path.join(self.base, 'b'), utils.safe_abs_path(self.base, "b")) self.assertEqual(os.path.join(self.base, 'b', 'c'), utils.safe_abs_path(self.base, "b", 'c')) self.assertEqual(self.base, utils.safe_abs_path(self.base, "b", 'c', '../..'))
def get_lock(self, name): path = utils.safe_abs_path(self._dir, name.decode()) if path in self._reserved_paths: raise ValueError("Unable to create a lock using" " reserved path '%s' for lock" " with name '%s'" % (path, name)) return locking.SharedWeakLockHelper(self._dir, FileLock, path)
def get_lock(self, name): path = utils.safe_abs_path(self._dir, name.decode()) if path in self._reserved_paths: raise ValueError("Unable to create a lock using" " reserved path '%s' for lock" " with name '%s'" % (path, name)) return self._get_raw_lock(path, self._member_id)