Exemplo n.º 1
0
def test_endpoints_are_extracted_from_absolute_urls():
    # TODO: Add an option to disable/enable this behaviour.
    assert extract_endpoints(q(b"http://foo/bar/baz")) \
        == set(["/bar/baz"])

    assert extract_endpoints(q(b"https://foo/bar/baz")) \
        == set(["/bar/baz"])
Exemplo n.º 2
0
def test_endpoints_with_template_args_are_caught():
    # TODO: Add an option to disable/enable this behaviour.
    assert extract_endpoints(q(b"/user/{id}/info")) \
        == set(["/user/{id}/info"])

    # TODO: Add an option to disable/enable this behaviour.
    assert extract_endpoints(q(b"/${postid}/")) \
        == set(["/${postid}/"])
Exemplo n.º 3
0
def test_fragment_is_preserved():
    # TODO: Add an option to disable/enable this behaviour.
    assert extract_endpoints(q(b"/foo/bar/quux#foobar")) \
        == set(["/foo/bar/quux#foobar"])
Exemplo n.º 4
0
def test_query_string_is_preserved():
    assert extract_endpoints(q(b"/foo/bar/baz?a=1&b=2")) \
        == set(["/foo/bar/baz?a=1&b=2"])
Exemplo n.º 5
0
def test_embedded_semicolon_is_preserved():
    assert extract_endpoints(q(b"/foo/bar/quux;baz") + b";") \
        == set(["/foo/bar/quux;baz"])
Exemplo n.º 6
0
def test_terminating_semicolon_is_stripped():
    assert extract_endpoints(q(b"/foo/bar/baz") + b";") \
        == set(["/foo/bar/baz"])
Exemplo n.º 7
0
def test_plain_single_quoted():
    assert extract_endpoints(q(b"/foo/bar/baz")) \
        == set(["/foo/bar/baz"])
Exemplo n.º 8
0
def test_plain():
    assert extract_endpoints(qq(b"/foo/bar/baz")) \
        == set(["/foo/bar/baz"])
Exemplo n.º 9
0
def test_no_slash():
    assert extract_endpoints(qq(b"foo/bar/baz")) == set()