mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-06-18 18:16:26 +00:00
Add more unit tests
This commit is contained in:
@ -45,11 +45,13 @@ func TestDebug(t *testing.T) {
|
||||
|
||||
assert.NoError(t, Configure(&Config{
|
||||
LogThreshold: DebugLevel,
|
||||
Formatter: "json",
|
||||
}))
|
||||
|
||||
Debug("This is a %s message", "test")
|
||||
assert.Contains(t, buf.String(), "DEBUG")
|
||||
assert.Contains(t, buf.String(), "This is a test message")
|
||||
Get()
|
||||
}
|
||||
|
||||
func TestInfo(t *testing.T) {
|
||||
@ -118,6 +120,16 @@ func TestConfigure(t *testing.T) {
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "configure json",
|
||||
args: args{
|
||||
&Config{
|
||||
LogThreshold: InfoLevel,
|
||||
Formatter: "json",
|
||||
},
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "invalid log level",
|
||||
args: args{
|
||||
@ -125,6 +137,13 @@ func TestConfigure(t *testing.T) {
|
||||
},
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "invalid config struct",
|
||||
args: args{
|
||||
nil,
|
||||
},
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
tt := tt
|
||||
|
Reference in New Issue
Block a user