Ejemplo n.º 1
0
def test_package_urls(domain, db_request):
    db_request.registry.settings = {}
    if domain:
        db_request.registry.settings = {'warehouse.domain': domain}
    db_request.domain = 'example.org'
    with pytest.raises(xmlrpc.XMLRPCWrappedError) as exc:
        xmlrpc.package_urls(db_request, 'foo', '1.0.0')

    assert exc.value.faultString == \
        ("RuntimeError: This API has been deprecated. Use "
         f"https://{domain if domain else 'example.org'}/foo/1.0.0/json "
         "instead. The XMLRPC method release_urls can be used in the "
         "interim, but will be deprecated in the future.")
Ejemplo n.º 2
0
def test_package_urls(domain, db_request):
    db_request.registry.settings = {}
    if domain:
        db_request.registry.settings = {'warehouse.domain': domain}
    db_request.domain = 'example.org'
    with pytest.raises(xmlrpc.XMLRPCWrappedError) as exc:
        xmlrpc.package_urls(db_request, 'foo', '1.0.0')

    assert exc.value.faultString == \
        ("RuntimeError: This API has been deprecated. Use "
         f"https://{domain if domain else 'example.org'}/foo/1.0.0/json "
         "instead. The XMLRPC method release_urls can be used in the "
         "interim, but will be deprecated in the future.")