mirror of
https://github.com/joohoi/acme-dns.git
synced 2025-01-12 15:57:51 +07:00
26 lines
559 B
Go
26 lines
559 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
log "github.com/Sirupsen/logrus"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestSetupLogging(t *testing.T) {
|
||
|
for i, test := range []struct {
|
||
|
format string
|
||
|
level string
|
||
|
expected string
|
||
|
}{
|
||
|
{"text", "warning", "warning"},
|
||
|
{"json", "debug", "debug"},
|
||
|
{"text", "info", "info"},
|
||
|
{"json", "error", "error"},
|
||
|
{"text", "something", "warning"},
|
||
|
} {
|
||
|
setupLogging(test.format, test.level)
|
||
|
if log.GetLevel().String() != test.expected {
|
||
|
t.Errorf("Test %d: Expected loglevel %s but got %s", i, test.expected, log.GetLevel().String())
|
||
|
}
|
||
|
}
|
||
|
}
|