(c *C)
| 189 | } |
| 190 | |
| 191 | func (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 | |
| 217 | func (s *LocalRepoCollectionSuite) TestDropNonExisting(c *C) { |
| 218 | repo := NewLocalRepo("local3", "Comment 3") |
nothing calls this directly
no test coverage detected