Creating snapshots from local repos.

This commit is contained in:
Andrey Smirnov
2014-02-26 21:02:34 +04:00
parent 2f30cf0846
commit 059abc465b
2 changed files with 33 additions and 0 deletions
+16
View File
@@ -32,6 +32,22 @@ func (s *SnapshotSuite) TestNewSnapshotFromRepository(c *C) {
c.Check(err, ErrorMatches, ".*not updated")
}
func (s *SnapshotSuite) TestNewSnapshotFromLocalRepo(c *C) {
localRepo := NewLocalRepo("lala", "hoorah!")
_, err := NewSnapshotFromLocalRepo("snap2", localRepo)
c.Check(err, ErrorMatches, "local repo doesn't have packages")
localRepo.UpdateRefList(s.reflist)
snapshot, _ := NewSnapshotFromLocalRepo("snap1", localRepo)
c.Check(snapshot.Name, Equals, "snap1")
c.Check(snapshot.NumPackages(), Equals, 3)
c.Check(snapshot.RefList().Len(), Equals, 3)
c.Check(snapshot.SourceKind, Equals, "local")
c.Check(snapshot.SourceIDs, DeepEquals, []string{localRepo.UUID})
}
func (s *SnapshotSuite) TestNewSnapshotFromPackageList(c *C) {
snap, _ := NewSnapshotFromRepository("snap1", s.repo)