main_test.go 327 B

123456789101112131415161718192021222324252627
  1. package main
  2. import (
  3. "os"
  4. "testing"
  5. "github.com/stretchr/testify/suite"
  6. )
  7. type MainTestSuite struct {
  8. suite.Suite
  9. oldConf config
  10. }
  11. func TestMain(m *testing.M) {
  12. initialize()
  13. os.Exit(m.Run())
  14. }
  15. func (s *MainTestSuite) SetupTest() {
  16. s.oldConf = conf
  17. }
  18. func (s *MainTestSuite) TearDownTest() {
  19. conf = s.oldConf
  20. }