To begin testing RAPIDS place the input data ``csv`` files in the ``tests/data/raw`` directory. The expected output of RAPIDS with the raw input data should be placed in the ``tests/data/processesd``.
Copy all files from ``tests/data/raw`` directory into the ``data/raw`` directory. The rule(s) that are to be tested must be placed in the ``tests/Snakemake`` file. The current ``tests/Snakemake`` is a good example of how to define the rules that are to be tested.
Store your test scripts in the ``tests/scripts`` directory. Next, you can run all rules in the ``tests/Snakemake`` with:
The above example runs the ``sms_features`` rule that is defined in the ``tests/Snakemake`` file. Replace this with the name of the rule you want to test. The ``--profile`` flag is used to run ``Snakemake`` with the ``Snakfile`` and ``confi.yaml`` file stored in ``tests/settings``.
Once RAPIDS has processed the sample data, the next step is to test the output. Testing is implemented using Python's Unittest. To run all the tests scripts stored in the ``tests/scripts`` directory use the following command:
The ``discover`` flag finds and runs all of the test scripts within the ``tests/scripts`` directory that start with ``test_``. The name of all test methods in the these scripts should also start with ``test_``.
The results above show that the first test ``test_sensors_files_exist`` passed while ``test_sensors_features_calculations`` failed. In addition you should get the traceback of the failure (not shown here). For more information on how to implement test scripts and use unittest please see `Unittest Documentation`_