github.com/cloud-green/juju@v0.0.0-20151002100041-a00291338d3d/environs/emptystorage_test.go (about)

     1  // Copyright 2013 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package environs_test
     5  
     6  import (
     7  	jc "github.com/juju/testing/checkers"
     8  	gc "gopkg.in/check.v1"
     9  
    10  	"github.com/juju/juju/environs"
    11  	"github.com/juju/juju/environs/storage"
    12  	"github.com/juju/juju/testing"
    13  )
    14  
    15  type EmptyStorageSuite struct {
    16  	testing.FakeJujuHomeSuite
    17  }
    18  
    19  var _ = gc.Suite(&EmptyStorageSuite{})
    20  
    21  func (s *EmptyStorageSuite) TestGet(c *gc.C) {
    22  	f, err := storage.Get(environs.EmptyStorage, "anything")
    23  	c.Assert(f, gc.IsNil)
    24  	c.Assert(err, gc.ErrorMatches, `file "anything" not found`)
    25  }
    26  
    27  func (s *EmptyStorageSuite) TestURL(c *gc.C) {
    28  	url, err := environs.EmptyStorage.URL("anything")
    29  	c.Assert(url, gc.Equals, "")
    30  	c.Assert(err, gc.ErrorMatches, `file "anything" not found`)
    31  }
    32  
    33  func (s *EmptyStorageSuite) TestList(c *gc.C) {
    34  	names, err := storage.List(environs.EmptyStorage, "anything")
    35  	c.Assert(names, gc.IsNil)
    36  	c.Assert(err, jc.ErrorIsNil)
    37  }