Closed StroemPhi closed 3 years ago
@andrecastro0o is this what you need?
should be a good to start from
@StroemPhi checkout branch issue78_tests branch
Is a simple pytest approach to testing the maps_to json, based on the code you posted here.
We can use the same scheme to test other components of the ontology.
See if you can run the tests in your system from the instructions in the new RADME Section: Development
If I get a bit of time I would like to integrate it with github actions so that the tests are run prior to each merge request.
Thank you @andrecastro0o! It works but I get the following warning
StroemertP@NB-W8P15450 MINGW64 ~/AEON/aeon (issue78_tests)
$ pytest
============================= test session starts =============================
platform win32 -- Python 3.8.2, pytest-6.1.2, py-1.9.0, pluggy-0.13.1
rootdir: C:\Users\StroemertP\AEON\aeon, configfile: pytest.ini, testpaths: tests
collected 2 items
tests/test_ontology.py::test_test PASSED [ 50%]
tests/test_ontology.py::test_maps_to_property PASSED [100%]
============================== warnings summary ===============================
..\..\appdata\local\programs\python\python38-32\lib\site-packages\win32\lib\pywintypes.py:2
c:\users\stroemertp\appdata\local\programs\python\python38-32\lib\site-packages\win32\lib\pywintypes.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp, sys, os
-- Docs: https://docs.pytest.org/en/stable/warnings.html
======================== 2 passed, 1 warning in 7.28s =========================
@StroemPhi those are not important they are windows warning relating to libraries that the imported libraries use. No reason to worry, but you can always start using Linux, "but can it run Doom?" yes, it can!
We need an automatic test that'll check if the JSON in the aeon:maps_to annotation property can be correctly parsed into a Python dict. The following code should run in the test without errors: