github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/apiserver/facades/client/bundle/mock_test.go (about)

     1  // Copyright 2018 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package bundle_test
     5  
     6  import (
     7  	"github.com/juju/description"
     8  	"github.com/juju/testing"
     9  
    10  	"github.com/juju/juju/apiserver/facades/client/bundle"
    11  	"github.com/juju/juju/state"
    12  )
    13  
    14  type mockState struct {
    15  	testing.Stub
    16  	bundle.Backend
    17  	model description.Model
    18  }
    19  
    20  func (m *mockState) ExportPartial(config state.ExportConfig) (description.Model, error) {
    21  	m.MethodCall(m, "ExportPartial", config)
    22  	if err := m.NextErr(); err != nil {
    23  		return nil, err
    24  	}
    25  
    26  	return m.model, nil
    27  }
    28  
    29  func (m *mockState) GetExportConfig() state.ExportConfig {
    30  	return state.ExportConfig{
    31  		SkipActions:            true,
    32  		SkipCloudImageMetadata: true,
    33  		SkipCredentials:        true,
    34  		SkipIPAddresses:        true,
    35  		SkipSSHHostKeys:        true,
    36  		SkipStatusHistory:      true,
    37  		SkipLinkLayerDevices:   true,
    38  	}
    39  }
    40  
    41  func newMockState() *mockState {
    42  	st := &mockState{
    43  		Stub: testing.Stub{},
    44  	}
    45  	return st
    46  }