Пример #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"
Пример #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:"
Пример #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/'
Пример #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'
Пример #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:'
Пример #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/'
Пример #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'
Пример #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:'
Пример #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/"
Пример #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/"
Пример #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"
Пример #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:"