-
- Downloads
Additional Python test infrastructure.
Add several methods to the Testing base class that all VTK-Python unit tests should inherit: + `pathToData(filename)`, which returns the full path to an input dataset specified on the command line given just the filename part as an argument; + `pathToValidatedOutput(filename)`, which returns the full path to a file containing validated baseline output (such as an image) given just the filename part as an argument; and + `prepareTestImage(interactor)`, which can be used in place of `vtk.test.Testing.compareImage(...)` when no baseline exists yet. When invoked, it starts the interactor. When the interactor finishes, the camera position and window size are printed as a Python script that can be pasted into a test. Some mouse and keyboard events are also returned to the program and could be used to inject interaction events for testing widgets. These methods make Python unit tests, especially those involving image comparison, significantly simpler to write and maintain.
Please register or sign in to comment