예제 #1
0
def test_https_logging_handler_logstash_auth_info():
    handler = HTTPSHandler(message_type='logstash',
                           username='******',
                           password='******')
    handler._add_auth_information()
    assert isinstance(handler.session.auth, requests.auth.HTTPBasicAuth)
    assert handler.session.auth.username == 'bob'
    assert handler.session.auth.password == 'ansible'
예제 #2
0
def test_https_logging_handler_splunk_auth_info():
    handler = HTTPSHandler(message_type='splunk', password='******')
    handler._add_auth_information()
    assert handler.session.headers['Authorization'] == 'Splunk ansible'
    assert handler.session.headers['Content-Type'] == 'application/json'