https://pulumi.com logo
#python
Title
l

little-journalist-4778

10/22/2021, 2:00 PM
I need to unit test a ComponentResource, it creates some resources but are not exposed, there's some way to get them from the test?
h

hallowed-teacher-48474

10/22/2021, 3:45 PM
Hey Fabio, the way we managed it is that we created a new class that inherits ComponentResource (Python) and expose these resources as class properties, so we can access them from the outside
f

freezing-van-87649

10/22/2021, 6:17 PM
One option we’ve been experimenting with is capturing them in the mock. We’ve got a mock option that captures all the resource/api call invocations and added some helper methods to find resources created with a given type.
h

hallowed-teacher-48474

10/22/2021, 11:31 PM
@freezing-van-87649 Nicee, this could be useful! 🤓
👍 1
l

little-journalist-4778

10/26/2021, 4:10 PM
TY @freezing-van-87649
👍 1
3 Views