MCPcopy
hub / github.com/dropbox/godropbox / TestGetCacheHit

Method TestGetCacheHit

caching/cache_on_storage_test.go:21–30  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

19}
20
21func (s *CacheOnStorageSuite) TestGetCacheHit(c *C) {
22 s.cache.Set(&testKeyVal{"foo", 1})
23 s.storage.Set(&testKeyVal{"foo", 10})
24
25 result, err := s.combined.Get("foo")
26 c.Assert(err, IsNil)
27 c.Assert(result, NotNil)
28 c.Assert(result.(*testKeyVal).key, Equals, "foo")
29 c.Assert(result.(*testKeyVal).val, Equals, 1)
30}
31
32func (s *CacheOnStorageSuite) TestGetCacheMiss(c *C) {
33 s.storage.Set(&testKeyVal{"foo", 10})

Callers

nothing calls this directly

Calls 2

SetMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected