6260: so many golint complaints!!
[arvados.git] / services / datamanager / collection / collection_test.go
index 4af5d4c8c4ae06896f639a6331e1bdfea347fa51..07c82e1abc0b5581c523683b4947e7d094f7c9cd 100644 (file)
@@ -16,13 +16,13 @@ type MySuite struct{}
 var _ = Suite(&MySuite{})
 
 // This captures the result we expect from
-// ReadCollections.Summarize().  Because CollectionUuidToIndex is
+// ReadCollections.Summarize().  Because CollectionUUIDToIndex is
 // indeterminate, we replace BlockToCollectionIndices with
 // BlockToCollectionUuids.
 type ExpectedSummary struct {
-       OwnerToCollectionSize  map[string]int
-       BlockToReplication     map[blockdigest.DigestWithSize]int
-       BlockToCollectionUuids map[blockdigest.DigestWithSize][]string
+       OwnerToCollectionSize     map[string]int
+       BlockToDesiredReplication map[blockdigest.DigestWithSize]int
+       BlockToCollectionUuids    map[blockdigest.DigestWithSize][]string
 }
 
 func CompareSummarizedReadCollections(c *C,
@@ -32,8 +32,8 @@ func CompareSummarizedReadCollections(c *C,
        c.Assert(summarized.OwnerToCollectionSize, DeepEquals,
                expected.OwnerToCollectionSize)
 
-       c.Assert(summarized.BlockToReplication, DeepEquals,
-               expected.BlockToReplication)
+       c.Assert(summarized.BlockToDesiredReplication, DeepEquals,
+               expected.BlockToDesiredReplication)
 
        summarizedBlockToCollectionUuids :=
                make(map[blockdigest.DigestWithSize]map[string]struct{})
@@ -41,7 +41,7 @@ func CompareSummarizedReadCollections(c *C,
                uuidSet := make(map[string]struct{})
                summarizedBlockToCollectionUuids[digest] = uuidSet
                for _, index := range indices {
-                       uuidSet[summarized.CollectionIndexToUuid[index]] = struct{}{}
+                       uuidSet[summarized.CollectionIndexToUUID[index]] = struct{}{}
                }
        }
 
@@ -67,15 +67,15 @@ func (s *MySuite) TestSummarizeSimple(checker *C) {
 
        rc.Summarize(nil)
 
-       c := rc.UuidToCollection["col0"]
+       c := rc.UUIDToCollection["col0"]
 
        blockDigest1 := blockdigest.MakeTestDigestWithSize(1)
        blockDigest2 := blockdigest.MakeTestDigestWithSize(2)
 
        expected := ExpectedSummary{
-               OwnerToCollectionSize:  map[string]int{c.OwnerUuid: c.TotalSize},
-               BlockToReplication:     map[blockdigest.DigestWithSize]int{blockDigest1: 5, blockDigest2: 5},
-               BlockToCollectionUuids: map[blockdigest.DigestWithSize][]string{blockDigest1: []string{c.Uuid}, blockDigest2: []string{c.Uuid}},
+               OwnerToCollectionSize:     map[string]int{c.OwnerUUID: c.TotalSize},
+               BlockToDesiredReplication: map[blockdigest.DigestWithSize]int{blockDigest1: 5, blockDigest2: 5},
+               BlockToCollectionUuids:    map[blockdigest.DigestWithSize][]string{blockDigest1: []string{c.UUID}, blockDigest2: []string{c.UUID}},
        }
 
        CompareSummarizedReadCollections(checker, rc, expected)
@@ -95,8 +95,8 @@ func (s *MySuite) TestSummarizeOverlapping(checker *C) {
 
        rc.Summarize(nil)
 
-       c0 := rc.UuidToCollection["col0"]
-       c1 := rc.UuidToCollection["col1"]
+       c0 := rc.UUIDToCollection["col0"]
+       c1 := rc.UUIDToCollection["col1"]
 
        blockDigest1 := blockdigest.MakeTestDigestWithSize(1)
        blockDigest2 := blockdigest.MakeTestDigestWithSize(2)
@@ -104,18 +104,18 @@ func (s *MySuite) TestSummarizeOverlapping(checker *C) {
 
        expected := ExpectedSummary{
                OwnerToCollectionSize: map[string]int{
-                       c0.OwnerUuid: c0.TotalSize,
-                       c1.OwnerUuid: c1.TotalSize,
+                       c0.OwnerUUID: c0.TotalSize,
+                       c1.OwnerUUID: c1.TotalSize,
                },
-               BlockToReplication: map[blockdigest.DigestWithSize]int{
+               BlockToDesiredReplication: map[blockdigest.DigestWithSize]int{
                        blockDigest1: 5,
                        blockDigest2: 8,
                        blockDigest3: 8,
                },
                BlockToCollectionUuids: map[blockdigest.DigestWithSize][]string{
-                       blockDigest1: []string{c0.Uuid},
-                       blockDigest2: []string{c0.Uuid, c1.Uuid},
-                       blockDigest3: []string{c1.Uuid},
+                       blockDigest1: []string{c0.UUID},
+                       blockDigest2: []string{c0.UUID, c1.UUID},
+                       blockDigest3: []string{c1.UUID},
                },
        }