dao_test.go 641 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package resource
  2. import (
  3. "context"
  4. "flag"
  5. "path/filepath"
  6. "testing"
  7. "go-common/app/interface/main/app-view/conf"
  8. . "github.com/smartystreets/goconvey/convey"
  9. )
  10. var (
  11. d *Dao
  12. )
  13. func init() {
  14. dir, _ := filepath.Abs("../../cmd/app-view-test.toml")
  15. flag.Set("conf", dir)
  16. conf.Init()
  17. d = New(conf.Conf)
  18. }
  19. func Test_Paster(t *testing.T) {
  20. Convey("should get banner", t, func() {
  21. _, err := d.Paster(context.Background(), 1, 2, "", "", "")
  22. So(err, ShouldBeNil)
  23. })
  24. }
  25. func Test_PlayerIcon(t *testing.T) {
  26. Convey("should get player icon", t, func() {
  27. _, err := d.PlayerIcon(context.Background())
  28. So(err, ShouldBeNil)
  29. })
  30. }