service_test.go 455 B

12345678910111213141516171819202122232425262728293031
  1. package service
  2. import (
  3. "flag"
  4. "path/filepath"
  5. "testing"
  6. "time"
  7. "go-common/app/job/main/credit/conf"
  8. . "github.com/smartystreets/goconvey/convey"
  9. )
  10. var (
  11. s *Service
  12. )
  13. func init() {
  14. dir, _ := filepath.Abs("../cmd/convey-test.toml")
  15. flag.Set("conf", dir)
  16. conf.Init()
  17. s = New(conf.Conf)
  18. time.Sleep(time.Second)
  19. }
  20. func TestService_loadCase(t *testing.T) {
  21. Convey("should return err be nil", t, func() {
  22. s.loadConf()
  23. s.loadCase()
  24. })
  25. }