steep-alligator-79173
07/02/2020, 8:23 PM# Get az's for region
azs = aws.get_availability_zones(state="available")
Now when I try to run test :
File "/Users/unittests/infra.py", line 79, in <module>
for num, az in enumerate(azs.zone_ids):
TypeError: 'NoneType' object is not iterable
in Pulumi documentation i found:
call(token: string, args: any, provider?: undefined | string): Record<string, any>
call mocks provider-implemented function calls (e.g. aws.get_availability_zones).
But I have no idea how I can mock this call. For any code snippet I would be gratefulfaint-table-42725
07/02/2020, 9:59 PMtoken
refers to the function being called. For example, if you look at https://github.com/pulumi/pulumi-aws/blob/master/sdk/python/pulumi_aws/acm/get_certificate.py#L103__ret__ = pulumi.runtime.invoke('aws:acm/getCertificate:getCertificate', __args__, opts=opts).value
aws:acm/getCertificate:getCertificate
is what token
will be when you call pulumi_aws.acm.get_certificate(...)
{}
for most functions if you don’t care about doing anything with them in your tests. If you do, you can compare against token
and then decide what relevant thing you want to return for your testing.