#Properly mocking methods in unit testing

1 messages · Page 1 of 1 (latest)

fiery topaz
#

Hello all, I am having a rough time attempting to mock FileInfo methods. Are there any examples of mocking the methods properly within the documentation?

While importing, we see
netapp_ontap.resources import Volume, QuotaReport, NfsClients, FileInfo

adding a print statement to confirm successful mock:
In fileInfo: <class 'netapp_ontap.resources.file_info.FileInfo'>

I am unfamiliar with how this is working considering the import does not explicitly call
file_info.py

I'm guessing there's some magic in the resources.init.py file. I am use to leaving this file empty, but this one has 1062 lines in it. I can only guess it's doing something that makes resources.file_info.FileInfo available for resources.FileInfo…
Once I am able to mock the instantiation
file = FileInfo(volUuid, path=filePath)
this will likely make a whole lot more sense 🙂