dao_test.go 803 B

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