It appear functions like `ec2.LookupVpc` don’t per...
# golang
g
It appear functions like
ec2.LookupVpc
don’t perform lookups in [unit] tests. Are there any examples of mocking them out?
l
I don't believe we have an example test that mocks out a get call. You can see the implementation of the mocks here: https://github.com/pulumi/pulumi/blob/master/sdk/go/pulumi/mocks.go any get/lookup function will ultimately call ReadResource wich calls NewResource in turn.
We do have an internal test in the Go SDK that tests ReadResource which may be useful reference: https://github.com/pulumi/pulumi/blob/master/sdk/go/pulumi/run_test.go#L155
g
👍 thanks for this. This helped