Add SnapshotCollection.ByUUID.

This commit is contained in:
Andrey Smirnov
2014-01-16 20:57:45 +04:00
parent 326d589f56
commit a8e6251a80
2 changed files with 15 additions and 1 deletions
+5 -1
View File
@@ -93,7 +93,7 @@ func (s *SnapshotCollectionSuite) TearDownTest(c *C) {
s.db.Close()
}
func (s *SnapshotCollectionSuite) TestAddByName(c *C) {
func (s *SnapshotCollectionSuite) TestAddByNameByUUID(c *C) {
snapshot, err := s.collection.ByName("snap1")
c.Assert(err, ErrorMatches, "*.not found")
@@ -110,6 +110,10 @@ func (s *SnapshotCollectionSuite) TestAddByName(c *C) {
snapshot, err = collection.ByName("snap1")
c.Assert(err, IsNil)
c.Assert(snapshot.String(), Equals, s.snapshot1.String())
snapshot, err = collection.ByUUID(s.snapshot1.UUID)
c.Assert(err, IsNil)
c.Assert(snapshot.String(), Equals, s.snapshot1.String())
}
func (s *SnapshotCollectionSuite) TestUpdateLoadComplete(c *C) {