MCPcopy Index your code
hub / github.com/aptly-dev/aptly / TestDrop

Method TestDrop

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

Source from the content-addressed store, hash-verified

189}
190
191func (s *LocalRepoCollectionSuite) TestDrop(c *C) {
192 repo1 := NewLocalRepo("local1", "Comment 1")
193 _ = s.collection.Add(repo1)
194
195 repo2 := NewLocalRepo("local2", "Comment 2")
196 _ = s.collection.Add(repo2)
197
198 r1, _ := s.collection.ByUUID(repo1.UUID)
199 c.Check(r1, Equals, repo1)
200
201 err := s.collection.Drop(repo1)
202 c.Check(err, IsNil)
203
204 _, err = s.collection.ByUUID(repo1.UUID)
205 c.Check(err, ErrorMatches, "local repo .* not found")
206
207 collection := NewLocalRepoCollection(s.db)
208 _, err = collection.ByName("local1")
209 c.Check(err, ErrorMatches, "local repo .* not found")
210
211 r2, _ := collection.ByName("local2")
212 c.Check(r2.String(), Equals, repo2.String())
213
214 c.Check(s.collection.Drop(repo1), ErrorMatches, "local repo not found")
215}
216
217func (s *LocalRepoCollectionSuite) TestDropNonExisting(c *C) {
218 repo := NewLocalRepo("local3", "Comment 3")

Callers

nothing calls this directly

Calls 9

ByNameMethod · 0.95
StringMethod · 0.95
NewLocalRepoFunction · 0.85
NewLocalRepoCollectionFunction · 0.85
DropMethod · 0.65
StringMethod · 0.65
AddMethod · 0.45
ByUUIDMethod · 0.45
CheckMethod · 0.45

Tested by

no test coverage detected