Esempio n. 1
0
def test__make_location_absolute_path():
    result = Response._make_location_absolute(
        {
            "wsgi.url_scheme": "http",
            "HTTP_HOST": "example.com:80"
        }, "/abc")
    assert result == "http://example.com/abc"
Esempio n. 2
0
def test__make_location_absolute_has_scheme_only():
    result = Response._make_location_absolute(
        {
            "wsgi.url_scheme": "http",
            "HTTP_HOST": "example.com:80"
        }, "http:")
    assert result == "http:"
Esempio n. 3
0
def test__make_location_absolute_already_absolute():
    result = Response._make_location_absolute(
        {
            'wsgi.url_scheme': 'http',
            'HTTP_HOST': 'example.com:80'
        }, 'https://funcptr.net/')
    assert result == 'https://funcptr.net/'
Esempio n. 4
0
def test__make_location_absolute_path():
    result = Response._make_location_absolute(
        {
            'wsgi.url_scheme': 'http',
            'HTTP_HOST': 'example.com:80'
        }, '/abc')
    assert result == 'http://example.com/abc'
Esempio n. 5
0
def test__make_location_absolute_has_scheme_only():
    result = Response._make_location_absolute(
        {
            'wsgi.url_scheme': 'http',
            'HTTP_HOST': 'example.com:80'
        }, 'http:')
    assert result == 'http:'
Esempio n. 6
0
def test__make_location_absolute_already_absolute():
    result = Response._make_location_absolute(
        {
            'wsgi.url_scheme': 'http',
            'HTTP_HOST': 'example.com:80'
        },
        'https://funcptr.net/'
    )
    assert result == 'https://funcptr.net/'
Esempio n. 7
0
def test__make_location_absolute_path():
    result = Response._make_location_absolute(
        {
            'wsgi.url_scheme': 'http',
            'HTTP_HOST': 'example.com:80'
        },
        '/abc'
    )
    assert result == 'http://example.com/abc'
Esempio n. 8
0
def test__make_location_absolute_has_scheme_only():
    result = Response._make_location_absolute(
        {
            'wsgi.url_scheme': 'http',
            'HTTP_HOST': 'example.com:80'
        },
        'http:'
    )
    assert result == 'http:'
Esempio n. 9
0
def test__make_location_absolute_already_absolute():
    result = Response._make_location_absolute(
        {
            "wsgi.url_scheme": "http",
            "HTTP_HOST": "example.com:80"
        },
        "https://funcptr.net/",
    )
    assert result == "https://funcptr.net/"
Esempio n. 10
0
def test__make_location_absolute_already_absolute():
    result = Response._make_location_absolute(
        {"wsgi.url_scheme": "http", "HTTP_HOST": "example.com:80"},
        "https://funcptr.net/",
    )
    assert result == "https://funcptr.net/"
Esempio n. 11
0
def test__make_location_absolute_path():
    result = Response._make_location_absolute(
        {"wsgi.url_scheme": "http", "HTTP_HOST": "example.com:80"}, "/abc"
    )
    assert result == "http://example.com/abc"
Esempio n. 12
0
def test__make_location_absolute_has_scheme_only():
    result = Response._make_location_absolute(
        {"wsgi.url_scheme": "http", "HTTP_HOST": "example.com:80"}, "http:"
    )
    assert result == "http:"