示例#1
0
def test_outbox_routes(route, handler):
    matching = [
        handler for r, handler in routes.outbox.routes
        if activity.match_route(r, route)
    ]
    assert len(matching) == 1, "Outbox route {} not found".format(route)
    assert matching[0] == handler
示例#2
0
def test_route_matching(route, payload, expected):
    assert activity.match_route(route, payload) is expected
示例#3
0
def test_match_route_ignore_payload_issues():
    payload = {"object": "http://hello"}
    assert activity.match_route({"object.type": "Test"}, payload) is False