Skip to content

Complete the set of unit tests for the config.py python script.

Tom Williams requested to merge AddUnitTestForConfigP2 into master
  • Complete the set of unit tests for src/swatch/config.py. Following up on !110 (merged).
    • The following iteration includes unit tests for LinkModeManager class and expand_link_id(), parse_index_list_string() and parse_system_file() functions.
  • As an auxiliary task, developed test suite for src/swatch/io_settings.py at tests/io_settings.
  • pytest and check packages have been used to develop the unit tests.
  • Updated exceptions from RuntimeError to InvalidConfigFormatError for all instances.
  • Raises issue #51 .

The following set of general rules were followed while developing the unit tests.

  • The test suite for any particular script is developed in a dedicated directory under tests/<PY_FILE_NAME>/ . The corresponding data used by the tests are stored in tests/<PY_FILE_NAME>/references/.
    • In this case these directories are tests/config/ and tests/config/references .
  • Test scripts for classes are named as test_CLASS_NAME.py while test scripts for non-internal functions are named as test_FUNCTION_NAME__.py.
    • The internal functions do not have dedicated test scripts for them but they are unit tested through the functions or classes that call them.
Edited by Abanti Ranadhir Sahasransu

Merge request reports