We have a simple class that does this:
...
bpy.ops.import_scene.gltf(filepath="path_to_file"))
bpy.ops.wm.save_as_mainfile(filepath="path_to_saved_file")
...
I want to test that we have called the proper functions with the proper names.
I do not seem to find a way to do that.
We are using purest.
with mocker.patch("bpy.ops.wm.save_as_mainfile") as mocked:
....
Gives me an error:
AttributeError: 'BPyOpsSubMod' object has no attribute 'save_as_mainfile'
My understanding that everything is a plugin and is initialised runtime.
I tried to mock the init function with no luck because you do not know on which object to mock it, and some of them have it private (shock)…
I tried to do maybe to get out the information from the console, but with no luck aswel.
(Pdb) bpy.ops.console.copy()
*** RuntimeError: Operator bpy.ops.console.copy.poll() failed, context is incorrect
What is the proper way to test that a call has been made to blender?