Esempio n. 1
0
def test_append_header():
    response = Response()
    response.set_header('x-test', 'foo')
    headers = [value for name, value in response.headerlist
               if name.title() == 'X-Test']
    assert ['foo'] == headers
    assert 'foo' == response['x-test']

    response.add_header('X-Test', 'bar')
    headers = [value for name, value in response.headerlist
               if name.title() == 'X-Test']
    assert ['foo', 'bar'] == headers
    assert 'foo' == response['x-test']