func USTestAppSummary(s store.UpdateStore, t *testing.T) { v := version.Version{App: "app1", Ver: "ver", Host: "a"} v.Prepare() s.Update(v) if _, ok := s.App("non-existant"); ok { t.Error("got ok for non-existant AppId") } if as, ok := s.App("app1"); ok { if as.HostCount != 1 { t.Error("expected HostCount: 1, actual: ", as.HostCount) } } else { t.Error("missing expected AppId") } v2 := version.Version{App: "app1", Ver: "ver", Host: "b"} v2.Prepare() s.Update(v2) if as, ok := s.App("app1"); ok { if as.HostCount != 2 { t.Error("expected HostCount: 2, actual: ", as.HostCount) } } }