You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
560 B
35 lines
560 B
package sidebar |
|
|
|
import ( |
|
"context" |
|
"flag" |
|
"path/filepath" |
|
"testing" |
|
|
|
"go-common/app/interface/main/app-interface/conf" |
|
|
|
. "github.com/smartystreets/goconvey/convey" |
|
) |
|
|
|
var d *Dao |
|
|
|
func init() { |
|
dir, _ := filepath.Abs("../cmd/app-interface-test.toml") |
|
flag.Set("conf", dir) |
|
conf.Init() |
|
d = New(conf.Conf) |
|
} |
|
|
|
func WithDao(f func(d *Dao)) func() { |
|
return func() { |
|
Reset(func() {}) |
|
f(d) |
|
} |
|
} |
|
|
|
func TestDao_Sidebar(t *testing.T) { |
|
Convey("ArchiveInfo", t, WithDao(func(d *Dao) { |
|
_, err := d.Sidebars(context.TODO()) |
|
So(err, ShouldBeNil) |
|
})) |
|
}
|
|
|