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.
33 lines
671 B
33 lines
671 B
package goblin |
|
|
|
import ( |
|
"testing" |
|
|
|
"context" |
|
|
|
"go-common/app/interface/main/tv/model" |
|
"go-common/library/cache/memcache" |
|
|
|
. "github.com/smartystreets/goconvey/convey" |
|
) |
|
|
|
func TestDao_Hotword(t *testing.T) { |
|
Convey("Hotword Test", t, WithDao(func(d *Dao) { |
|
ctx := context.TODO() |
|
conn := d.mc.Get(ctx) |
|
s := []*model.Hotword{ |
|
{ |
|
Keyword: "Test1", |
|
}, |
|
{ |
|
Keyword: "Test2", |
|
}, |
|
} |
|
defer conn.Close() |
|
err := conn.Set(&memcache.Item{Key: _hotwordKey, Object: s, Flags: memcache.FlagJSON, Expiration: 1200}) |
|
So(err, ShouldBeNil) |
|
hotwordList, err := d.Hotword(ctx) |
|
So(err, ShouldBeNil) |
|
So(len(hotwordList), ShouldBeGreaterThan, 0) |
|
})) |
|
}
|
|
|