github.com/makyo/juju@v0.0.0-20160425123129-2608902037e9/cmd/juju/storage/package_test.go (about)

     1  // Copyright 2015 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package storage_test
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/juju/cmd"
    10  	jc "github.com/juju/testing/checkers"
    11  	gc "gopkg.in/check.v1"
    12  
    13  	"github.com/juju/juju/cmd/modelcmd"
    14  	"github.com/juju/juju/jujuclient"
    15  	"github.com/juju/juju/jujuclient/jujuclienttesting"
    16  	jujutesting "github.com/juju/juju/testing"
    17  )
    18  
    19  func TestAll(t *testing.T) {
    20  	gc.TestingT(t)
    21  }
    22  
    23  type BaseStorageSuite struct {
    24  	jujutesting.FakeJujuXDGDataHomeSuite
    25  
    26  	command cmd.Command
    27  }
    28  
    29  func (s *BaseStorageSuite) SetUpTest(c *gc.C) {
    30  	s.FakeJujuXDGDataHomeSuite.SetUpTest(c)
    31  }
    32  
    33  func (s *BaseStorageSuite) TearDownTest(c *gc.C) {
    34  	s.FakeJujuXDGDataHomeSuite.TearDownTest(c)
    35  }
    36  
    37  type SubStorageSuite struct {
    38  	jujutesting.FakeJujuXDGDataHomeSuite
    39  	store *jujuclienttesting.MemStore
    40  }
    41  
    42  func (s *SubStorageSuite) SetUpTest(c *gc.C) {
    43  	s.FakeJujuXDGDataHomeSuite.SetUpTest(c)
    44  
    45  	err := modelcmd.WriteCurrentController("testing")
    46  	c.Assert(err, jc.ErrorIsNil)
    47  	s.store = jujuclienttesting.NewMemStore()
    48  	s.store.Controllers["testing"] = jujuclient.ControllerDetails{}
    49  	s.store.Accounts["testing"] = &jujuclient.ControllerAccounts{
    50  		CurrentAccount: "admin@local",
    51  	}
    52  }