def test_package_data(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_data(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_data can be used in the " "interim, but will be deprecated in the future.")