

def test_access_logger_dicts():
    log_format = '%{User-Agent}i %{Content-Length}o %{SPAM}e %{None}i'
    mock_logger = mock.Mock()
    access_logger = helpers.AccessLogger(mock_logger, log_format)
    message = mock.Mock(headers={
        'USER-AGENT': 'Mock/1.0',
    }, version=(1, 1))
    environ = {
        'SPAM': 'EGGS',
    }
    response = mock.Mock(headers={
        'CONTENT-LENGTH': 123,
    })
    transport = mock.Mock()
    transport.get_extra_info.return_value = ('127.0.0.2', 1234)
    access_logger.log(message, environ, response, transport, 0.0)
    assert (not mock_logger.error.called)
    expected = 'Mock/1.0 123 EGGS -'
    mock_logger.info.assert_called_with(expected)

dataset/ETHPy150Open KeepSafe/aiohttp/tests/test_helpers.py test_access_logger_dicts/original