示例#1
0
def test_clean_response_headers(mock):
    from devpi_server.replica import clean_response_headers
    response = mock.Mock()
    response.headers = dict(foo='bar')
    # make sure the result is a case insensitive header dict
    headers = clean_response_headers(response)
    assert 'foo' in headers
    assert 'FOO' in headers
    assert 'bar' not in headers
    headers['egg'] = 'ham'
    assert 'egg' in headers
    assert 'EGG' in headers
示例#2
0
def test_clean_response_headers(mock):
    from devpi_server.replica import clean_response_headers

    response = mock.Mock()
    response.headers = dict(foo="bar")
    # make sure the result is a case insensitive header dict
    headers = clean_response_headers(response)
    assert "foo" in headers
    assert "FOO" in headers
    assert "bar" not in headers
    headers["egg"] = "ham"
    assert "egg" in headers
    assert "EGG" in headers