live_test.go 649 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package live
  2. import (
  3. "context"
  4. "flag"
  5. "path/filepath"
  6. "testing"
  7. "time"
  8. "go-common/app/interface/main/app-wall/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-wall-test.toml")
  19. flag.Set("conf", dir)
  20. conf.Init()
  21. d = New(conf.Conf)
  22. time.Sleep(time.Second)
  23. }
  24. func TestPack(t *testing.T) {
  25. Convey("Pack", t, func() {
  26. err := d.Pack(ctx(), 1, 1)
  27. So(err, ShouldBeNil)
  28. })
  29. }
  30. func TestAddVip(t *testing.T) {
  31. Convey("AddVip", t, func() {
  32. _, err := d.AddVip(ctx(), 1, 1)
  33. So(err, ShouldBeNil)
  34. })
  35. }