(c *C)
| 890 | } |
| 891 | |
| 892 | func (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 | |
| 918 | const exampleReleaseFile = `Origin: LP-PPA-agenda-developers-daily |
| 919 | Label: Agenda Daily Builds |
nothing calls this directly
no test coverage detected