github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/cloudconfig/cloudinit/cloudinittest/fake.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package cloudinittest 5 6 import ( 7 "github.com/juju/testing" 8 9 "github.com/juju/juju/cloudconfig/cloudinit" 10 ) 11 12 type CloudConfig struct { 13 cloudinit.CloudConfig 14 testing.Stub 15 16 YAML []byte 17 Script string 18 } 19 20 func (c *CloudConfig) RenderYAML() ([]byte, error) { 21 c.MethodCall(c, "RenderYAML") 22 return c.YAML, c.NextErr() 23 } 24 25 func (c *CloudConfig) RenderScript() (string, error) { 26 c.MethodCall(c, "RenderScript") 27 return c.Script, c.NextErr() 28 }