def test_malformed_destinations(monkeypatch):
 monkeypatch.setenv('WALE_SYSLOG_FACILITY', 'wat')
 (out, valid_facility) = log_help.get_syslog_facility()
 assert (not valid_facility)
 assert (out == handlers.SysLogHandler.LOG_USER)
 monkeypatch.setenv('WALE_SYSLOG_FACILITY', 'local0,wat')
 (out, valid_facility) = log_help.get_syslog_facility()
 assert (not valid_facility)
 assert (out == handlers.SysLogHandler.LOG_USER)
 monkeypatch.setenv('WALE_SYSLOG_FACILITY', ',')
 (out, valid_facility) = log_help.get_syslog_facility()
 assert (not valid_facility)
 assert (out == handlers.SysLogHandler.LOG_USER)

def test_malformed_destinations ( monkeypatch ) : monkeypatch . setenv ( 'WALE_SYSLOG_FACILITY' , 'wat' ) ( out , valid_facility ) = log_help . get_syslog_facility ( ) assert ( not valid_facility ) assert ( out == handlers . SysLogHandler . LOG_USER ) monkeypatch . setenv ( 'WALE_SYSLOG_FACILITY' , 'local0,wat' ) ( out , valid_facility ) = log_help . get_syslog_facility ( ) assert ( not valid_facility ) assert ( out == handlers . SysLogHandler . LOG_USER ) monkeypatch . setenv ( 'WALE_SYSLOG_FACILITY' , ',' ) ( out , valid_facility ) = log_help . get_syslog_facility ( ) assert ( not valid_facility ) assert ( out == handlers . SysLogHandler . LOG_USER )
wale_syslog_facility contains bogus values .