Exemplo n.º 1
0
def bb_webhooks_handler():
    router.route(request.headers["X-Event-Key"], request.json)
    return ("", 204)
Exemplo n.º 2
0
def test_pr_merged_router() -> None:
    with open("tests/sample_data/pull_request_merged.json") as f:
        data = json.load(f)
    assert router.route("pullrequest:fulfilled", data) == ["pr_merged"]
Exemplo n.º 3
0
def test_pr_comment_deleted_router() -> None:
    with open("tests/sample_data/pr_comment_deleted.json") as f:
        data = json.load(f)
    assert router.route("pullrequest:comment_deleted", data) == ["pr_comment_deleted"]
Exemplo n.º 4
0
def test_repo_push_router() -> None:
    with open("tests/sample_data/repo_push.json") as f:
        data = json.load(f)
    assert router.route("repo:push", data) == ["repo_pushed_1", "repo_pushed_2"]
Exemplo n.º 5
0
def test_no_handler_available() -> None:
    assert router.route("random:event", {}) is None