Merge pull request #1187 from stevvooe/check-storage-drivers-list-path-not-found

[WIP] registry/storage/driver: checking that non-existent path returns PathNotFoundError
This commit is contained in:
Richard Scothern 2015-12-08 16:32:02 -08:00
commit e6363e8a20
7 changed files with 37 additions and 15 deletions

View file

@ -472,6 +472,13 @@ func (suite *DriverSuite) TestList(c *check.C) {
rootDirectory := "/" + randomFilename(int64(8+rand.Intn(8)))
defer suite.StorageDriver.Delete(suite.ctx, rootDirectory)
doesnotexist := path.Join(rootDirectory, "nonexistent")
_, err := suite.StorageDriver.List(suite.ctx, doesnotexist)
c.Assert(err, check.Equals, storagedriver.PathNotFoundError{
Path: doesnotexist,
DriverName: suite.StorageDriver.Name(),
})
parentDirectory := rootDirectory + "/" + randomFilename(int64(8+rand.Intn(8)))
childFiles := make([]string, 50)
for i := 0; i < len(childFiles); i++ {