ncasuk / amf-check-writer

Library to write AMF compliance checks
BSD 3-Clause "New" or "Revised" License
0 stars 4 forks source link

Test pyessv with our old vocabularies #25

Closed agstephens closed 3 years ago

agstephens commented 4 years ago

@gapintheclouds Assuming you have your base environment activated. Try:

git clone https://github.com/ES-DOC/pyessv

export PYESSV_ARCHIVE_HOME=<YOUR_WORKING_DIR>/compliance-check-lib/cc-vocab-cache/pyessv-archive-eg-cvs

Then save this in a script (test-pyessv.py) and see if it runs okay with python test-pyessv.py:

import pyessv

# Authority: ncas.
ncas = pyessv.NCAS
assert isinstance(ncas, pyessv.Authority)

print('ncas/amf/flux-components-variable/air-pressure')

amf = ncas.amf
assert isinstance(amf, pyessv.Scope)

fcv = amf.flux_components_variable
assert isinstance(fcv, pyessv.Collection)

air_pressure = fcv.air_pressure
assert isinstance(air_pressure, pyessv.Term)

assert pyessv.load('ncas:amf:flux-components-variable') == fcv

assert pyessv.load('ncas:amf:flux-components-variable:air-pressure') == air_pressure

It seems to work fine for me.

gapintheclouds commented 4 years ago

@agstephens Yes, that works. Thanks.