dao_test.go 522 B

1234567891011121314151617181920212223242526272829303132333435
  1. package dao
  2. import (
  3. "context"
  4. "flag"
  5. "path/filepath"
  6. "testing"
  7. "go-common/app/job/main/upload/conf"
  8. . "github.com/smartystreets/goconvey/convey"
  9. )
  10. var d *Dao
  11. func init() {
  12. dir, _ := filepath.Abs("../cmd/bfs-upload-job.toml")
  13. flag.Set("conf", dir)
  14. conf.Init()
  15. d = New(conf.Conf)
  16. }
  17. func TestPing(t *testing.T) {
  18. Convey("Ping", t, func() {
  19. err := d.Ping(context.TODO())
  20. So(err, ShouldBeNil)
  21. })
  22. }
  23. func TestClose(t *testing.T) {
  24. Convey("Ping", t, func() {
  25. err := d.Close
  26. So(err, ShouldBeNil)
  27. })
  28. }