github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/cmd/juju/crossmodel/package_test.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package crossmodel_test 5 6 import ( 7 "testing" 8 9 gc "gopkg.in/check.v1" 10 11 "github.com/juju/juju/core/model" 12 "github.com/juju/juju/jujuclient" 13 jujutesting "github.com/juju/juju/testing" 14 ) 15 16 func TestAll(t *testing.T) { 17 gc.TestingT(t) 18 } 19 20 type BaseCrossModelSuite struct { 21 jujutesting.BaseSuite 22 23 store *jujuclient.MemStore 24 } 25 26 func (s *BaseCrossModelSuite) SetUpTest(c *gc.C) { 27 // Set up the current controller, and write just enough info 28 // so we don't try to refresh 29 controllerName := "test-master" 30 s.store = jujuclient.NewMemStore() 31 s.store.CurrentControllerName = controllerName 32 s.store.Controllers[controllerName] = jujuclient.ControllerDetails{} 33 s.store.Models[controllerName] = &jujuclient.ControllerModels{ 34 CurrentModel: "fred/test", 35 Models: map[string]jujuclient.ModelDetails{ 36 "bob/test": {ModelUUID: "test-uuid", ModelType: model.IAAS}, 37 "bob/prod": {ModelUUID: "prod-uuid", ModelType: model.IAAS}, 38 "fred/test": {ModelUUID: "fred-uuid", ModelType: model.IAAS}, 39 }, 40 } 41 s.store.Accounts[controllerName] = jujuclient.AccountDetails{ 42 User: "bob", 43 } 44 }