def test_package_releases(db_request): project1 = ProjectFactory.create() releases1 = [ReleaseFactory.create(project=project1) for _ in range(10)] project2 = ProjectFactory.create() [ReleaseFactory.create(project=project2) for _ in range(10)] result = xmlrpc.package_releases(db_request, project1.name) assert result == [ r.version for r in sorted(releases1, key=lambda x: x._pypi_ordering) ]
def test_package_releases_hidden(db_request): project1 = ProjectFactory.create() releases1 = [ReleaseFactory.create(project=project1) for _ in range(10)] project2 = ProjectFactory.create() [ReleaseFactory.create(project=project2) for _ in range(10)] result = xmlrpc.package_releases(db_request, project1.name, show_hidden=True) assert result == [ r.version for r in reversed(sorted(releases1, key=lambda x: x._pypi_ordering)) ]
def test_package_releases_no_releases(db_request): project = ProjectFactory.create() result = xmlrpc.package_releases(db_request, project.name) assert result == []
def test_package_releases_no_project(db_request): result = xmlrpc.package_releases(db_request, "foo") assert result == []