Skip to content

Updated: Unit tests (#1)

Sunil Mohan Adapa requested to merge BobGirard:unit-tests-1 into master

Created by: BobGirard

This commit adds three unit test modules to the codebase, the first in what is intended to be a series of test code submissions. A new plinth/tests/data directory has also been added, to serve as a repository for miscellaneous test data.

Testing of cfg.py exposed two refactoring opportunities:

  1. An explicit check was added to verify the existence of the secondary (non-default) plinth.config file.
  2. The configparser.SafeConfigParser class was replaced with configparser.ConfigParser to resolve a DeprecationWarning.

Note: Two tests in test_menu.py have had to be marked as skipped, and kvstore.py could not be tested at all, since they seem to require Django to be running and configured prior to initiation of the 'test' command. If anyone can suggest a (hopefully lightweight) solution or workaround for this significant dependency issue, I'd be very grateful to know about it, and would apply it with my next set of tests.

Merge request reports

Loading