Example #1
0
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)
    ]
Example #2
0
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))
    ]
Example #3
0
def test_package_releases_no_releases(db_request):
    project = ProjectFactory.create()
    result = xmlrpc.package_releases(db_request, project.name)
    assert result == []
Example #4
0
def test_package_releases_no_project(db_request):
    result = xmlrpc.package_releases(db_request, "foo")
    assert result == []
Example #5
0
def test_package_releases_no_releases(db_request):
    project = ProjectFactory.create()
    result = xmlrpc.package_releases(db_request, project.name)
    assert result == []
Example #6
0
def test_package_releases_no_project(db_request):
    result = xmlrpc.package_releases(db_request, "foo")
    assert result == []