Highly-opinionated (ex-bullshit-free) MTPROTO proxy for Telegram. If you use v1.0 or upgrade broke you proxy, please read the chapter Version 2
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

base_internal_test.go 593B

123456789101112131415161718192021222324252627282930313233
  1. package cli
  2. import (
  3. "path/filepath"
  4. "testing"
  5. "github.com/stretchr/testify/suite"
  6. )
  7. type BaseTestSuite struct {
  8. suite.Suite
  9. b base
  10. }
  11. func (suite *BaseTestSuite) SetupTest() {
  12. suite.b = base{}
  13. }
  14. func (suite *BaseTestSuite) TestReadConfigNok() {
  15. suite.b.ConfigPath = filepath.Join("testdata", "unknown")
  16. suite.Error(suite.b.ReadConfig("dev"))
  17. }
  18. func (suite *BaseTestSuite) TestReadConfig() {
  19. suite.b.ConfigPath = filepath.Join("testdata", "minimal.toml")
  20. suite.NoError(suite.b.ReadConfig("dev"))
  21. }
  22. func TestBase(t *testing.T) {
  23. t.Parallel()
  24. suite.Run(t, &BaseTestSuite{})
  25. }