Sub Controller Unit Tests #377
Replies: 2 comments
-
@zacsimile @annie-xd-wang @AdvancedImagingUTSW I wanted to get feedback on my plan for testing the controllers and view. I have added a dummy view and dummy controller to the conftest file. You can see it below:
I was playing around with Monkeypatching and Mocking but realized that may be overkill. My thought is that, at least for the sub controllers, we can use the dummy controller class that has the functions called by the sub controllers. Typically the only calls are to "execute" and the dictionary configuration attribute. The dummy controller will use the dummy model's configuration and the "execute" function will return a string. This isolates the sub-controllers from the main controller and the model. Here is what the dummy controller looks like in code:
The dummy view will act as the Tkinter test environment. We can pass the dummy view to the sub controllers so that we can test the bindings for sub controller callbacks. This allows for the sub-controllers to be isolated from the view. Here is a diagram: The red circles represent what needs to be mocked, mimicked or monkey patched. |
Beta Was this translation helpful? Give feedback.
-
Would love to hear your opinions @zacsimile and @annie-xd-wang |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
All reactions