Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_tls_handler_init():
with pytest.raises(ValueError):
GelfTlsHandler(host='127.0.0.1', port=12204, validate=True)
with pytest.raises(ValueError):
GelfTlsHandler(host='127.0.0.1', port=12204, keyfile='/dev/null')
def test_tls_handler_init():
with pytest.raises(ValueError):
GelfTlsHandler(host='127.0.0.1', port=12204, validate=True)
with pytest.raises(ValueError):
GelfTlsHandler(host='127.0.0.1', port=12204, keyfile='/dev/null')
GelfTlsHandler(host='127.0.0.1', port=12204, static_fields=STATIC_FIELDS),
# GelfTlsHandler(host='127.0.0.1', port=12204, validate=True, ca_certs='tests/config/cert.pem', static_fields=STATIC_FIELDS, _ozzy='billie jean'),
])
def handler(request):
return request.param
GelfTlsHandler(host='127.0.0.1', port=12204, **STATIC_FIELDS),
# GelfTlsHandler(host='127.0.0.1', port=12204, validate=True, ca_certs='tests/config/cert.pem', **STATIC_FIELDS),
GelfTcpHandler(host='127.0.0.1', port=12201, static_fields=STATIC_FIELDS, _ozzy='billie jean'),
GelfUdpHandler(host='127.0.0.1', port=12202, static_fields=STATIC_FIELDS, _ozzy='billie jean'),
GelfUdpHandler(host='127.0.0.1', port=12202, compress=False, static_fields=STATIC_FIELDS, _ozzy='billie jean'),
GelfHttpHandler(host='127.0.0.1', port=12203, static_fields=STATIC_FIELDS, _ozzy='billie jean'),
GelfHttpHandler(host='127.0.0.1', port=12203, compress=False, static_fields=STATIC_FIELDS, _ozzy='billie jean'),
GelfTlsHandler(host='127.0.0.1', port=12204, static_fields=STATIC_FIELDS),
# GelfTlsHandler(host='127.0.0.1', port=12204, validate=True, ca_certs='tests/config/cert.pem', static_fields=STATIC_FIELDS, _ozzy='billie jean'),
])
def handler(request):
return request.param
def test_handler_certfile_required_for_keyfile():
with pytest.raises(ValueError):
GelfTlsHandler(host='127.0.0.1', port=12001, keyfile="./somefile.key")
GelfTlsHandler(host='127.0.0.1', port=12204, include_extra_fields=True),
# GelfTlsHandler(host='127.0.0.1', port=12204, validate=True, ca_certs='tests/config/cert.pem', include_extra_fields=True),
])
def handler(request):
return request.param
GelfTlsHandler(host='127.0.0.1', port=12000, debug=True, **ADDITIONAL_FIELDS)
])
def handler(request):
return request.param
GelfTlsHandler(host='127.0.0.1', port=12204),
# GelfTlsHandler(host='127.0.0.1', port=12204, validate=True, ca_certs='tests/config/cert.pem'),
])
def handler(request):
return request.param
def test_handler_creation():
with pytest.raises(ValueError):
GelfTlsHandler(host='127.0.0.1', port=12001, validate=True)
GelfTlsHandler(host='127.0.0.1', port=12000, include_extra_fields=True)
])
def handler(request):
return request.param