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

Method TestAddMultiSimple

memcache/mock_client_test.go:44–66  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

42}
43
44func (s *MockClientSuite) TestAddMultiSimple(c *C) {
45 item1 := createTestItem()
46 item2 := createTestItem()
47 item2.Key = "foo"
48 items := []*Item{item1, item2}
49
50 resps := s.client.AddMulti(items)
51
52 c.Assert(resps, HasLen, 2)
53 for i := 0; i < 2; i++ {
54 item := items[i]
55 resp := resps[i]
56
57 c.Assert(resp.Error(), IsNil)
58 c.Assert(resp.Key(), Equals, item.Key)
59 c.Assert(resp.DataVersionId(), Equals, uint64(1+i))
60
61 gresp := s.client.Get(item.Key)
62 c.Assert(gresp.Error(), IsNil)
63 c.Assert(bytes.Equal(gresp.Value(), item.Value), IsTrue)
64 c.Assert(gresp.DataVersionId(), Equals, uint64(1+i))
65 }
66}
67
68func (s *MockClientSuite) TestAddMultiEmpty(c *C) {
69 items := make([]*Item, 0)

Callers

nothing calls this directly

Calls 7

createTestItemFunction · 0.85
AddMultiMethod · 0.65
ErrorMethod · 0.65
KeyMethod · 0.65
DataVersionIdMethod · 0.65
GetMethod · 0.65
ValueMethod · 0.65

Tested by

no test coverage detected