Smoke test for pyami and py4ami - petermr/CEVOpen GitHub Wiki

  • I am running smoke test for pyami on Windows 10.

  • I git cloned pyami, set environment variable and then ran following commands and got following results.

  • python examples.py gl no error

    **

  • python examples.py pd error

    "stat: path should be string, bytes, os.PathLike or integer, not NoneType"

  • Solved above error by editing generic.py line 19 os.stat(path) with os.stat(str(path))

    **

  • Ran again python examples.py pd

  • Now error is (Please, find txt logfile here) logfile

  • I think we need to refer http://net-informations.com/python/err/nonetype.htm and edit symbol.py

    **

  • Second error: when I run pyami --help it opens PyMol (open source molecular visualization system)

    Pymol


py4ami Installation and testing dictionaries

git clone https://github.com/petermr/pyami

pip install py4ami

  1. Run cd /Users/sagar/pyami/test open the test_pyamidict_tdd.py code in any code editor and add .. at lines 14 and 15 before 'py4ami'. So the lines 14 and 15 should be :
from ..py4ami.xml_lib import XmlLib
from ..py4ami.dict_lib import AMIDict, AMIDictError, Synonym, Entry

Run cd /Users/sagar/pyami/test pytest test_pyamidict_tdd.py in the test folder. Ran 58 tests passed.

  1. open the pyami/test/test_cevopen_tps_dictionaries.py code in any code editor and add .. at line 1 before 'py4ami'. So the line 1 should be :
from ..py4ami.dict_lib import AMIDict
  1. Run pytest test_cevopen_tps_dictionaries.py in the test folder. Ran 4 test_dictionaries, 3 passed 1 failed.
pyami.py4ami.dict_lib.AMIDictError: Failed to read URL: https://raw.githubusercontent.com/petermr/crops/main/Vitis%20vinifera/eo_Gene.xml; reason = Not Found

../py4ami/dict_lib.py:496: AMIDictError
FAILED test_cevopen_tps_dictionaries.py::test_vitis_is_valid - pyami.py4ami.dict_lib.AMIDictError: Failed to read URL: https://raw.githubusercontent.com/petermr/crops/main/Vitis%20vinifera/eo_Gene.xml;...
  1. Added 21 dictionaries and also defined their paths by editing test_pyamidict_tdd.py

73 tests passed

`test_pyamidict_tdd.py::test_mini_camelliatps_is_valid test_pyamidict_tdd.py::test_mini_citrustps_is_valid test_pyamidict_tdd.py::test_mini_zeatps_is_valid test_pyamidict_tdd.py::test_mini_vitistps_is_valid test_pyamidict_tdd.py::test_mini_tpsenzyme_is_valid test_pyamidict_tdd.py::test_mini_mentha_tps_dict_is_valid test_pyamidict_tdd.py::test_ethnobot_dict_has_version test_pyamidict_tdd.py::test_ethnobot_dict_is_valid test_pyamidict_tdd.py::test_ethnobot_dict_has_8_entries test_pyamidict_tdd.py::test_ethnobot_dict_entry_0_is_valid test_pyamidict_tdd.py::test_all_ethnobot_dict_entries_are_valid

========================= 5 failed, 73 passed in 3.02s ========================= `

5 dictionaries failed because of wikidata id (parsing problem??)

Validating all 21 dictionaries

  1. Added 21 dictionaries [all 21 dictionaries version 0.0.1].
    (https://github.com/petermr/crops/tree/main/dictinaries) and also defined their paths by editing test_pyamidict_tdd.py

    81 tests passed, 3 failed Camelliatps is failing. I am trying to edit it properly. "Solvents" dictionary creation problem.

======================================================================================== short test summary info ======================================================================================== FAILED test_pyamidict_tdd.py::test_mini_camelliatps_is_valid - File "/Users/sagar/pyami/py4ami/resources/amidicts/mini_camelliatps.xml", line 295 FAILED test_pyamidict_tdd.py::test_create_dictionary_from_list_of_string_save_and_compare - AssertionError: <dictionary version="0.0.1" title="solvents" encoding="UTF-8"> FAILED test_pyamidict_tdd.py::test_create_dictionary_from_list_of_string_and_add_Wikidata - AssertionError: <dictionary version="0.0.1" title="solvents" encoding="UTF-8"> ================================================================================ 3 failed, 81 passed in 81.02s (0:01:21)