Search snapshots by source repo.

This commit is contained in:
Andrey Smirnov
2014-01-29 16:16:24 +04:00
parent 26267802e9
commit 555256c1fe
2 changed files with 25 additions and 0 deletions
+12
View File
@@ -158,3 +158,15 @@ func (s *SnapshotCollectionSuite) TestForEachAndLen(c *C) {
})
c.Assert(err, Equals, e)
}
func (s *SnapshotCollectionSuite) TestFindByRemoteRepoSource(c *C) {
c.Assert(s.collection.Add(s.snapshot1), IsNil)
c.Assert(s.collection.Add(s.snapshot2), IsNil)
c.Check(s.collection.ByRemoteRepoSource(s.repo1), DeepEquals, []*Snapshot{s.snapshot1})
c.Check(s.collection.ByRemoteRepoSource(s.repo2), DeepEquals, []*Snapshot{s.snapshot2})
repo3, _ := NewRemoteRepo("other", "http://mirror.yandex.ru/debian/", "lenny", []string{"main"}, []string{})
c.Check(s.collection.ByRemoteRepoSource(repo3), DeepEquals, []*Snapshot{})
}