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')]
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")])
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:')]
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:")])