38 lines
548 B
Go
38 lines
548 B
Go
package wall
|
|
|
|
import (
|
|
"flag"
|
|
"path/filepath"
|
|
"testing"
|
|
"time"
|
|
|
|
"go-common/app/interface/main/app-wall/conf"
|
|
|
|
. "github.com/smartystreets/goconvey/convey"
|
|
)
|
|
|
|
var (
|
|
s *Service
|
|
)
|
|
|
|
func WithService(f func(s *Service)) func() {
|
|
return func() {
|
|
f(s)
|
|
}
|
|
}
|
|
|
|
func init() {
|
|
dir, _ := filepath.Abs("../../cmd/app-wall-test.toml")
|
|
flag.Set("conf", dir)
|
|
conf.Init()
|
|
s = New(conf.Conf)
|
|
time.Sleep(time.Second)
|
|
}
|
|
|
|
func TestWall(t *testing.T) {
|
|
Convey("Wall", t, WithService(func(s *Service) {
|
|
res := s.Wall()
|
|
So(res, ShouldNotBeEmpty)
|
|
}))
|
|
}
|