conf_test.go 668 B

1234567891011121314151617181920212223242526272829303132
  1. package conf
  2. import (
  3. "flag"
  4. "os"
  5. "testing"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestMain(m *testing.M) {
  9. defer os.Exit(0)
  10. flag.Set("conf", "../cmd/block-admin-test.toml")
  11. var err error
  12. if err = Init(); err != nil {
  13. panic(err)
  14. }
  15. m.Run()
  16. }
  17. func TestConf(t *testing.T) {
  18. Convey("conf", t, func() {
  19. So(Conf.Property.MSG, ShouldNotBeNil)
  20. So(Conf.Property.MSG.BlackHouseForever, ShouldNotBeNil)
  21. So(Conf.Property.MSG.BlackHouseLimit, ShouldNotBeNil)
  22. So(Conf.Property.MSG.BlockRemove, ShouldNotBeNil)
  23. So(Conf.Property.MSG.SysForever, ShouldNotBeNil)
  24. So(Conf.Property.MSG.SysLimit, ShouldNotBeNil)
  25. t.Log(Conf.Property.MSG)
  26. })
  27. }