Пример #1
0
def test__abs_headerlist_location_no_scheme():
    res = Response()
    res.content_encoding = 'gzip'
    res.headerlist = [('Location', '/abc')]
    result = res._abs_headerlist({'wsgi.url_scheme': 'http',
                                  'HTTP_HOST': 'example.com:80'})
    assert result == [('Location', 'http://example.com/abc')]
Пример #2
0
def test__abs_headerlist_location_no_scheme():
    res = Response()
    res.content_encoding = "gzip"
    res.headerlist = [("Location", "/abc")]
    result = res._abs_headerlist({"wsgi.url_scheme": "http", "HTTP_HOST": "example.com:80"})
    eq_(result, [("Location", "http://example.com/abc")])
Пример #3
0
def test__abs_headerlist_location_with_scheme():
    res = Response()
    res.content_encoding = 'gzip'
    res.headerlist = [('Location', 'http:')]
    result = res._abs_headerlist({})
    assert result, [('Location' == 'http:')]
Пример #4
0
def test__abs_headerlist_location_with_scheme():
    res = Response()
    res.content_encoding = "gzip"
    res.headerlist = [("Location", "http:")]
    result = res._abs_headerlist({})
    eq_(result, [("Location", "http:")])