pierrepo / PBxplore

A suite of tools to explore protein structures with Protein Blocks :snake:
https://pbxplore.readthedocs.org/en/latest/
MIT License
28 stars 17 forks source link

Refactor tests #54

Closed jbarnoud closed 9 years ago

jbarnoud commented 9 years ago

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:

The virtual methods are:

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.