Open weilixu opened 1 month ago
Adding mock module to the test code
NOTE! The test failed for now since I do not understand the data structure coming back from DOE2. In this example, the code mocked the data returning from the function
get_multiple_results
. When running test, theget_multiple_results
are bypassed and returning thereturn_value
.This can be cleaned up a bit.
The idea is unit test is not testing eQuest module, they should be assumed to be correct. The goal here is to make sure the other part of the logics are correct, for example
populate_data_group
.I also suggest adding unit tests to static methods such as the ones under BaseNode class.
Exception catch may missing in places, for example, the
d2_result_dll = ctypes.CDLL(d2_result_dll)
raise exception when the file is not found - catching this error would be helpful for front-end.
Thanks Weili! The plan was to have file validation be handled here: https://github.com/Karpman-Consulting/eQUEST-229RPDGenerator/blob/development/interface/main_app_window.py#L253
We are also considering the possibility of adjusting the plan to incorporate these RPD features into a new release of eQUEST, and expanding the eQUEST interface.
Adding mock module to the test code
NOTE! The test failed for now since I do not understand the data structure coming back from DOE2. In this example, the code mocked the data returning from the function
get_multiple_results
. When running test, theget_multiple_results
are bypassed and returning thereturn_value
.This can be cleaned up a bit.
The idea is unit test is not testing eQuest module, they should be assumed to be correct. The goal here is to make sure the other part of the logics are correct, for example
populate_data_group
.I also suggest adding unit tests to static methods such as the ones under BaseNode class.
Exception catch may missing in places, for example, the
d2_result_dll = ctypes.CDLL(d2_result_dll)
raise exception when the file is not found - catching this error would be helpful for front-end.