Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for quality standard template #788

Merged
merged 4 commits into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions weldx/tests/asdf_tests/installable_quality_standard_check.py
Original file line number Diff line number Diff line change
@@ -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")