def test_release_data(db_request): project = ProjectFactory.create() release = ReleaseFactory.create(project=project) urls = [pretend.stub(), pretend.stub()] urls_iter = iter(urls) db_request.route_url = pretend.call_recorder( lambda r, **kw: next(urls_iter) ) assert xmlrpc.release_data(db_request, project.name, release.version) == { "name": release.project.name, "version": release.version, "stable_version": release.project.stable_version, "bugtrack_url": release.project.bugtrack_url, "package_url": urls[0], "release_url": urls[1], "docs_url": release.project.documentation_url, "home_page": release.home_page, "download_url": release.download_url, "project_url": list(release.project_urls), "author": release.author, "author_email": release.author_email, "maintainer": release.maintainer, "maintainer_email": release.maintainer_email, "summary": release.summary, "description": release.description, "license": release.license, "keywords": release.keywords, "platform": release.platform, "classifiers": list(release.classifiers), "requires": list(release.requires), "requires_dist": list(release.requires_dist), "provides": list(release.provides), "provides_dist": list(release.provides_dist), "obsoletes": list(release.obsoletes), "obsoletes_dist": list(release.obsoletes_dist), "requires_python": release.requires_python, "requires_external": list(release.requires_external), "_pypi_ordering": release._pypi_ordering, "_pypi_hidden": release._pypi_hidden, "downloads": { "last_day": -1, "last_week": -1, "last_month": -1, }, "cheesecake_code_kwalitee_id": None, "cheesecake_documentation_id": None, "cheesecake_installability_id": None, } db_request.route_url.calls == [ pretend.call("packaging.project", name=project.name), pretend.call( "packaging.release", name=project.name, version=release.version, ), ]
def test_release_data(db_request): project = ProjectFactory.create() release = ReleaseFactory.create(project=project) urls = [pretend.stub(), pretend.stub()] urls_iter = iter(urls) db_request.route_url = pretend.call_recorder( lambda r, **kw: next(urls_iter)) assert xmlrpc.release_data(db_request, project.name, release.version) == { "name": release.project.name, "version": release.version, "stable_version": release.project.stable_version, "bugtrack_url": release.project.bugtrack_url, "package_url": urls[0], "release_url": urls[1], "docs_url": release.project.documentation_url, "home_page": release.home_page, "download_url": release.download_url, "project_url": list(release.project_urls), "author": release.author, "author_email": release.author_email, "maintainer": release.maintainer, "maintainer_email": release.maintainer_email, "summary": release.summary, "description": release.description, "license": release.license, "keywords": release.keywords, "platform": release.platform, "classifiers": list(release.classifiers), "requires": list(release.requires), "requires_dist": list(release.requires_dist), "provides": list(release.provides), "provides_dist": list(release.provides_dist), "obsoletes": list(release.obsoletes), "obsoletes_dist": list(release.obsoletes_dist), "requires_python": release.requires_python, "requires_external": list(release.requires_external), "_pypi_ordering": release._pypi_ordering, "_pypi_hidden": release._pypi_hidden, "downloads": { "last_day": -1, "last_week": -1, "last_month": -1, }, "cheesecake_code_kwalitee_id": None, "cheesecake_documentation_id": None, "cheesecake_installability_id": None, } db_request.route_url.calls == [ pretend.call("packaging.project", name=project.name), pretend.call( "packaging.release", name=project.name, version=release.version, ), ]
def test_release_data_no_release(db_request): project = ProjectFactory.create() assert xmlrpc.release_data(db_request, project.name, "1.0") == {}
def test_release_data_no_project(db_request): assert xmlrpc.release_data(db_request, "foo", "1.0") == {}