Skip to content

Smoke test for pyami and py4ami

Sagar Jadhav edited this page Oct 12, 2021 · 17 revisions
  • 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

  1. git cloned pyami. set path by running command open -e .bash_profile. then copying the following. export P2_HOME=/Users/sagar/pyami

    export PATH=$PATH:$P2_HOME/py4ami

  2. created folder valdict in pyami. add interpreter conda env, python 3.8, select conda path. Run the commands

    conda create --name project_env python=3.8.0

    conda activate project_env save. close.

    Reopen folder. run pip install pytest. run test_pyamidict.py then gave lxml error. pip install lxml. run again test_pyamidict.py . then gave py4ami module not found error. then run pip install py4ami. Then gave error ImportError: cannot import name 'AMIDict' from 'py4ami.dict_lib'.

  3. 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.

Testing Dictionaries

Pyami code for testing dictionaries pyami/test/test_cevopen_tps_dictionaries.py.

  1. Run cd /Users/sagar/pyami/test
  2. 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;...
Clone this wiki locally