示例#1
0
def _setup_app_context_for_test():
    """
    Given app is session-wide, sets up a app context per test to ensure that
    app and request stack is not shared between tests.
    """
    ctx = application.app_context()
    ctx.push()
    yield  # tests will run here
    ctx.pop()
示例#2
0
def get_koji_build_info_url_from_flask(id_: int = None, ) -> str:
    """
    provide absolute URL to p-s koji build logs view meant to set in a commit status
    """
    with application.app_context():
        return url_for(
            "builds.koji_build_info",
            id_=id_,
            _external=
            True,  # _external = generate a URL with FQDN, not a relative one
        )
示例#3
0
def get_srpm_log_url_from_flask(id_: int = None, ) -> str:
    """
    provide absolute URL to p-s srpm build logs view meant to set in a commit status
    """
    # flask magic
    with application.app_context():
        return url_for(
            "builds.get_srpm_build_logs_by_id",
            id_=id_,
            _external=
            True,  # _external = generate a URL with FQDN, not a relative one
        )