main_test.go 375 B

1234567891011121314151617181920212223242526272829
  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. // Reset presets
  18. conf.Presets = make(presets)
  19. }
  20. func (s *MainTestSuite) TearDownTest() {
  21. conf = s.oldConf
  22. }