byteface / domonic

Create HTML with python 3 using a standard DOM API. Includes a python port of JavaScript for interoperability and tons of other cool features. A fast prototyping library.
https://domonic.readthedocs.io/
MIT License
129 stars 13 forks source link

unit test and assertion for any existing or new method #20

Open byteface opened 2 years ago

byteface commented 2 years ago

If you want to get involved then create an assertion in a unit test for any given method. some are still just print statements at the moment.

this may also uncover bugs. so be prepared.

or create a new unit test for a method that isn't done yet and make it work. good luck

byteface commented 2 years ago

See Makefile to run all tests:

make test

NOTE - default tests ubuntu. so will fail on window when terminal test runs. comment out locally if that's the case

or to test a single function: python -m unittest tests.test_javascript.TestCase.test_javascript_array python -m unittest tests.test_dQuery.TestCase.test_addClass python -m unittest tests.test_geom.TestCase.test_vec2 python3 -m unittest tests.test_cmd.TestCase.test_cmd_dir # only windows

or to test a whole module: python -m unittest tests.test_html python -m unittest tests.test_CDN

to see coverage: coverage run -m unittest discover tests/ coverage report