Regression tests were very redondant. The test case classes shared the SetUp and TearDown methods, and they all had very similar functions to run the program and validate its output. This pull request factorises these method in a template class from which the other classes inherit.
The TemplateTestCase defines a set of methods common to all test suites, and a set of virtual methods that all test suites should overload.
The common methods are:
SetUp
TearDown
_run_program_and_validate
The virtual methods are:
_build_command_line
_validate_output_files
The tests for PBassign do inherit from the template. Yet, their initial design was different from the tests for the other programs. Indeed, while the tests for PBcount and PBclust run the program once per test method, the tests for PBassign test several structures and several file formats, each. Therefore, these tests do not use the _build_command_line, the _validate_output_files method, nor the _run_program_and_validate methods.
Regression tests were very redondant. The test case classes shared the SetUp and TearDown methods, and they all had very similar functions to run the program and validate its output. This pull request factorises these method in a template class from which the other classes inherit.
The
TemplateTestCase
defines a set of methods common to all test suites, and a set of virtual methods that all test suites should overload.The common methods are:
SetUp
TearDown
_run_program_and_validate
The virtual methods are:
_build_command_line
_validate_output_files
The tests for
PBassign
do inherit from the template. Yet, their initial design was different from the tests for the other programs. Indeed, while the tests forPBcount
andPBclust
run the program once per test method, the tests forPBassign
test several structures and several file formats, each. Therefore, these tests do not use the_build_command_line
, the_validate_output_files
method, nor the_run_program_and_validate
methods.