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

Method TestDrop

deb/remote_test.go:892–916  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

890}
891
892func (s *RemoteRepoCollectionSuite) TestDrop(c *C) {
893 repo1, _ := NewRemoteRepo("yandex", "http://mirror.yandex.ru/debian/", "squeeze", []string{"main"}, []string{}, false, false, false, false)
894 _ = s.collection.Add(repo1)
895
896 repo2, _ := NewRemoteRepo("tyndex", "http://mirror.yandex.ru/debian/", "wheezy", []string{"main"}, []string{}, false, false, false, false)
897 _ = s.collection.Add(repo2)
898
899 r1, _ := s.collection.ByUUID(repo1.UUID)
900 c.Check(r1, Equals, repo1)
901
902 err := s.collection.Drop(repo1)
903 c.Check(err, IsNil)
904
905 _, err = s.collection.ByUUID(repo1.UUID)
906 c.Check(err, ErrorMatches, "mirror .* not found")
907
908 collection := NewRemoteRepoCollection(s.db)
909 _, err = collection.ByName("yandex")
910 c.Check(err, ErrorMatches, "mirror .* not found")
911
912 r2, _ := collection.ByName("tyndex")
913 c.Check(r2.String(), Equals, repo2.String())
914
915 c.Check(s.collection.Drop(repo1), ErrorMatches, "repo not found")
916}
917
918const exampleReleaseFile = `Origin: LP-PPA-agenda-developers-daily
919Label: Agenda Daily Builds

Callers

nothing calls this directly

Calls 9

ByNameMethod · 0.95
StringMethod · 0.95
NewRemoteRepoFunction · 0.85
NewRemoteRepoCollectionFunction · 0.85
DropMethod · 0.65
StringMethod · 0.65
AddMethod · 0.45
ByUUIDMethod · 0.45
CheckMethod · 0.45

Tested by

no test coverage detected