GeorgeCiesinski / text-script

An app that runs in the background and replaces text shortcuts with pre-saved blocks of text.
https://georgeciesinski.github.io/text-script/
GNU General Public License v3.0
72 stars 9 forks source link

UnitTest for glib #22

Closed GeorgeCiesinski closed 4 years ago

GeorgeCiesinski commented 4 years ago

Write unit test using the UnitTest library for glib.py

Opening this issue as this will be the first unit test for this program.

Adding resources:

  1. Testing your code: https://docs.python-guide.org/writing/tests/

  2. Resolve import issues: https://alex.dzyoba.com/blog/python-import/

  3. Tutorial: https://www.youtube.com/watch?v=6tNS--WetLI

GeorgeCiesinski commented 4 years ago

Found a way to run the test:

From console, run "python -m unittest tests.test_glib

GeorgeCiesinski commented 4 years ago

Resource to better organize the tests: https://docs.python.org/3/library/unittest.html#organizing-tests

GeorgeCiesinski commented 4 years ago

Switched from unit test to pytest. Testing is also automated by Travis CI now.

GeorgeCiesinski commented 4 years ago

Completed in commit: https://github.com/GeorgeCiesinski/text-script/commit/2c3ffae1035ccb69d02f46273d2e1679fde04a30