mirror of
https://github.com/chrislusf/seaweedfs
synced 2024-05-20 02:10:20 +02:00
26 lines
513 B
Go
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())
|
|
}
|