def test_routes_correctly(url, match, handler, uuids):
    control = CalvinControl()
    handler_func, mo = control._handler_for_route(url.format(**uuids))
    assert handler_func is not None
    assert handler_func.__name__ == handler
    assert mo is not None
    if match is not None:
        # If any of the 'match'es are in uuids we assume they should be uuids
        match = [uuids.get(m, m) for m in match]
        assert list(mo.groups()) == match
예제 #2
0
def test_routes_correctly(url, match, handler, uuids):
    control = CalvinControl()
    handler_func, mo = control._handler_for_route(url.format(**uuids))
    assert handler_func is not None
    assert handler_func.__name__ == handler
    assert mo is not None
    if match is not None:
        # If any of the 'match'es are in uuids we assume they should be uuids
        match = [uuids.get(m, m) for m in match]
        assert list(mo.groups()) == match
예제 #3
0
def test_routes_correctly(url, match, handler):
    control = CalvinControl()
    handler = control._handler_for_route(url)
    assert handler is not None