Esempio n. 1
0
func (t *CacherSuite) TestGet(ch *C) {
	opts := cacher.Options{}
	opts.Engine = cacher.LOCALCACHE

	cacher.InitCache(opts)

	cacher.Set("c", []byte("d"))

	a := cacher.Get("c")

	ch.Assert(string(a), Equals, "d")
}
Esempio n. 2
0
func (t *CacherSuite) TestDelete(ch *C) {
	opts := cacher.Options{}
	opts.Engine = cacher.LOCALCACHE

	cacher.InitCache(opts)

	cacher.Set("e", []byte("f"))

	cacher.Delete("e")

	a := cacher.Get("e")

	ch.Assert(len(a), Equals, 0)
}