def from_request(cls, install_request, installation_root): install_chroot = os.path.join(installation_root, install_request.fingerprint, install_request.wheel_file) return cls(request=install_request, installation_root=installation_root, atomic_dir=AtomicDirectory(install_chroot))
def from_request(cls, build_request, dist_root): dist_dir = os.path.join( dist_root, 'sdists' if os.path.isfile(build_request.source_path) else 'local_projects', os.path.basename(build_request.source_path), build_request.fingerprint, build_request.target.id) return cls(request=build_request, atomic_dir=AtomicDirectory(dist_dir))
def atomic_directory_finalize_test(errno, expect_raises=None): with mock.patch("os.rename", spec_set=True, autospec=True) as mock_rename: mock_rename.side_effect = OSError(errno, os.strerror(errno)) with maybe_raises(expect_raises): AtomicDirectory("to.dir").finalize()