terraform: provider mock should close itself to find bugs
This commit is contained in:
parent
00a177cd99
commit
d6f7261190
|
@ -10,6 +10,8 @@ type MockResourceProvider struct {
|
|||
// Anything you want, in case you need to store extra data with the mock.
|
||||
Meta interface{}
|
||||
|
||||
CloseCalled bool
|
||||
CloseError error
|
||||
InputCalled bool
|
||||
InputInput UIInput
|
||||
InputConfig *ResourceConfig
|
||||
|
@ -55,6 +57,11 @@ type MockResourceProvider struct {
|
|||
ValidateResourceReturnErrors []error
|
||||
}
|
||||
|
||||
func (p *MockResourceProvider) Close() error {
|
||||
p.CloseCalled = true
|
||||
return p.CloseError
|
||||
}
|
||||
|
||||
func (p *MockResourceProvider) Input(
|
||||
input UIInput, c *ResourceConfig) (*ResourceConfig, error) {
|
||||
p.InputCalled = true
|
||||
|
|
|
@ -6,4 +6,5 @@ import (
|
|||
|
||||
func TestMockResourceProvider_impl(t *testing.T) {
|
||||
var _ ResourceProvider = new(MockResourceProvider)
|
||||
var _ ResourceProviderCloser = new(MockResourceProvider)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue