diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 33f308573..74a53cd97 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -85,6 +85,26 @@ jobs: run: | pytest --cov-append ./weldx/tests/asdf_tests/quality_standards_check.py + - name: install cookiecutter + if: matrix.py == '3.8' + run: | + pip install cookiecutter + + - name: create installable quality standard from repo + if: matrix.py == '3.8' + run: | + cookiecutter --no-input https://github.com/BAMWeldx/quality-standard-template + + - name: install quality standard + if: matrix.py == '3.8' + run: | + pip install -e ./quality_standard_demo + + - name: test installable quality standard from template repository + if: matrix.py == '3.8' + run: | + pytest --cov-append ./weldx/tests/asdf_tests/installable_quality_standard_check.py + - name: coverage xml (combination is performed by pytest-cov) if: matrix.py == '3.8' run: coverage xml diff --git a/weldx/tests/asdf_tests/installable_quality_standard_check.py b/weldx/tests/asdf_tests/installable_quality_standard_check.py new file mode 100644 index 000000000..c7769aa48 --- /dev/null +++ b/weldx/tests/asdf_tests/installable_quality_standard_check.py @@ -0,0 +1,20 @@ +import pytest +from asdf import ValidationError + +from weldx import WeldxFile +from weldx.config import enable_quality_standard +from weldx.measurement import MeasurementEquipment + + +def test_installable_quality_standard(): + enable_quality_standard("quality_standard_demo") + + eq = MeasurementEquipment("Equipment") + + tree = dict(equip=eq) + + with pytest.raises(ValidationError): + WeldxFile(tree=tree, mode="rw") + + eq.wx_metadata = {"serial_number": 1234} + WeldxFile(tree=tree, mode="rw")