MCPcopy Create free account
hub / github.com/aptly-dev/aptly / TestUpdateLoadComplete

Method TestUpdateLoadComplete

deb/local_test.go:148–167  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

146}
147
148func (s *LocalRepoCollectionSuite) TestUpdateLoadComplete(c *C) {
149 repo := NewLocalRepo("local1", "Comment 1")
150 c.Assert(s.collection.Update(repo), IsNil)
151
152 collection := NewLocalRepoCollection(s.db)
153 r, err := collection.ByName("local1")
154 c.Assert(err, IsNil)
155 c.Assert(r.packageRefs, IsNil)
156
157 repo.packageRefs = s.reflist
158 c.Assert(s.collection.Update(repo), IsNil)
159
160 collection = NewLocalRepoCollection(s.db)
161 r, err = collection.ByName("local1")
162 c.Assert(err, IsNil)
163 c.Assert(r.packageRefs, IsNil)
164 c.Assert(r.NumPackages(), Equals, 0)
165 c.Assert(s.collection.LoadComplete(r), IsNil)
166 c.Assert(r.NumPackages(), Equals, 2)
167}
168
169func (s *LocalRepoCollectionSuite) TestForEachAndLen(c *C) {
170 repo := NewLocalRepo("local1", "Comment 1")

Callers

nothing calls this directly

Calls 6

ByNameMethod · 0.95
NewLocalRepoFunction · 0.85
NewLocalRepoCollectionFunction · 0.85
UpdateMethod · 0.65
NumPackagesMethod · 0.45
LoadCompleteMethod · 0.45

Tested by

no test coverage detected