conf_test.go 237 B

123456789101112131415161718
  1. package conf
  2. import (
  3. "flag"
  4. "testing"
  5. )
  6. func TestInit(t *testing.T) {
  7. flag.Set("conf", "../cmd/answer-job-test.toml")
  8. flag.Parse()
  9. var err error
  10. if err = Init(); err != nil {
  11. t.Fatal(err)
  12. }
  13. if Conf == nil {
  14. t.Fatal()
  15. }
  16. }