Files
mautrix-telegram/pkg/gotd/telegram/internal/e2etest/options.go
T
2025-06-27 20:03:37 -07:00

38 lines
634 B
Go

package e2etest
import (
"io"
"go.uber.org/zap"
"go.mau.fi/mautrix-telegram/pkg/gotd/constant"
"go.mau.fi/mautrix-telegram/pkg/gotd/crypto"
)
// TestOptions contains some common test server settings.
type TestOptions struct {
AppID int
AppHash string
DC int
Random io.Reader
Logger *zap.Logger
}
func (opt *TestOptions) setDefaults() {
if opt.AppID == 0 {
opt.AppID = constant.TestAppID
}
if opt.AppHash == "" {
opt.AppHash = constant.TestAppHash
}
if opt.DC == 0 {
opt.DC = 2
}
if opt.Random == nil {
opt.Random = crypto.DefaultRand()
}
if opt.Logger == nil {
opt.Logger = zap.NewNop()
}
}