ChEB-AI / python-chebai

GNU Affero General Public License v3.0
12 stars 4 forks source link

Preprocessing unit tests #45

Closed sfluegel05 closed 1 week ago

sfluegel05 commented 3 months ago

We already have some tests for data preprocessing. However, those are more integration tests that capture the behaviour of the tool as a whole than unit tests for specific functions. In order to efficiently test the different preprocessing functionalities, we need to add some smaller-scale unit tests. Those should not include real data, but sample input values that can be generated from scratch.

Here are the classes / functions that should be covered (from the implementation in the protein_prediction branch reader.py:

For some functions, it is necessary to read from / write to files. Instead of real files, I would suggest to use mock objects (see e.g. this comment)

aditya0by0 commented 2 months ago

How to Run All Tests in a Given Folder

To run all unit tests in a specific folder using Python's unittest framework, you can use the unittest discover command.

Command Example:

python -m unittest discover -s <test_folder> -t <top-level-directory> -p "<pattern>" 

Explanation of Parameters:

Running All Tests in tests/unit Folder Example:

python -m unittest discover -s G:\github-aditya0by0\python-chebai\tests\unit -t G:\github-aditya0by0\python-chebai

image

aditya0by0 commented 3 weeks ago
  • Tox21MolNet: setup_processed(), _load_data_from_file()

The test case for above class is not added/covered in this issue, due to issue #53. It will added after completion of the issue.

sfluegel05 commented 2 weeks ago

The toxicity-related tests have not been merged yet. They will be included in #56 (see also issue #53)