1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-05-20 02:10:20 +02:00
seaweedfs/weed/weed_test.go
2024-04-21 01:50:04 +03:00

26 lines
513 B
Go

package main
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestInitSentryNoDSN(t *testing.T) {
assert.Nil(t, initSentry())
}
func TestInitSentryEmptyDSN(t *testing.T) {
t.Setenv("SENTRY_DSN", "")
assert.Nil(t, initSentry())
}
func TestInitSentryTestDSN(t *testing.T) {
t.Setenv("SENTRY_DSN", "https://example@example.com/123")
assert.Nil(t, initSentry())
}
func TestInitSentryInvalidDSN(t *testing.T) {
t.Setenv("SENTRY_DSN", "https://example.com")
assert.NotNil(t, initSentry())
}