account_test.go 742 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package account
  2. import (
  3. "context"
  4. "flag"
  5. "path/filepath"
  6. "testing"
  7. "time"
  8. "go-common/app/interface/main/app-channel/conf"
  9. . "github.com/smartystreets/goconvey/convey"
  10. )
  11. var (
  12. d *Dao
  13. )
  14. func ctx() context.Context {
  15. return context.Background()
  16. }
  17. func init() {
  18. dir, _ := filepath.Abs("../../cmd/app-channel-test.toml")
  19. flag.Set("conf", dir)
  20. conf.Init()
  21. d = New(conf.Conf)
  22. time.Sleep(time.Second)
  23. }
  24. func TestRelations3(t *testing.T) {
  25. Convey("get Relations3 all", t, func() {
  26. res := d.Relations3(ctx(), []int64{1}, 1)
  27. So(res, ShouldNotBeEmpty)
  28. })
  29. }
  30. func TestCards3(t *testing.T) {
  31. Convey("get Cards3 all", t, func() {
  32. res, err := d.Cards3(ctx(), []int64{1})
  33. So(res, ShouldNotBeEmpty)
  34. So(err, ShouldBeNil)
  35. })
  36. }