def test_get_syslog_facility_notempty(monkeypatch):
 monkeypatch.setenv('WALE_SYSLOG_FACILITY', 'local0')
 (out, valid_facility) = log_help.get_syslog_facility()
 assert (valid_facility is True)
 assert (out == handlers.SysLogHandler.LOG_LOCAL0)
 monkeypatch.setenv('WALE_SYSLOG_FACILITY', 'user')
 (out, valid_facility) = log_help.get_syslog_facility()
 assert (valid_facility is True)
 assert (out == handlers.SysLogHandler.LOG_USER)

def test_get_syslog_facility_notempty ( monkeypatch ) : monkeypatch . setenv ( 'WALE_SYSLOG_FACILITY' , 'local0' ) ( out , valid_facility ) = log_help . get_syslog_facility ( ) assert ( valid_facility is True ) assert ( out == handlers . SysLogHandler . LOG_LOCAL0 ) monkeypatch . setenv ( 'WALE_SYSLOG_FACILITY' , 'user' ) ( out , valid_facility ) = log_help . get_syslog_facility ( ) assert ( valid_facility is True ) assert ( out == handlers . SysLogHandler . LOG_USER )
wale_syslog_facility is set .