From 4d05093d2174cc75470c6bcf1e95b2431a821fa6 Mon Sep 17 00:00:00 2001 From: Noel Merket Date: Mon, 12 Jul 2021 10:42:44 -0600 Subject: [PATCH 1/2] adding schema test github action --- .github/workflows/tests.yml | 20 ++++++++++++++++++ .gitignore | 2 +- .../test_schema.cpython-39-pytest-6.2.4.pyc | Bin 0 -> 591 bytes tests/requirements.txt | 2 ++ tests/test_schema.py | 10 +++++++++ 5 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/tests.yml create mode 100644 tests/__pycache__/test_schema.cpython-39-pytest-6.2.4.pyc create mode 100644 tests/requirements.txt create mode 100644 tests/test_schema.py diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..93abb590 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,20 @@ +name: Test Schemas + +on: [pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actiona/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r tests/requirements.txt + - name: Test with pytest + run: | + pytest tests diff --git a/.gitignore b/.gitignore index a190ea51..c7cce850 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ guide/build .idea .DS_Store - +.vscode diff --git a/tests/__pycache__/test_schema.cpython-39-pytest-6.2.4.pyc b/tests/__pycache__/test_schema.cpython-39-pytest-6.2.4.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d5224617b54b0d1f8f88decb7126e2d1d2a0d934 GIT binary patch literal 591 zcmYjP%}(4f5FR_pCRteE+9LH>HJ9WCP=(YBstQ6vNR=;XSWmm5&L*-=*+p=IGtaPl z>?`@o35h4*#5gNfJJNif&z^s|8jXfP^7!ZF*Cz(>0$s)z!k}bBDaJel;GLYc|h#kq!Ad8+UADm>&MQAnR*wc66 zWJILjNX-`l3kzns4J6yALZrby+_NRS^Dp5okVQ>V+VJFt=edZ@c!Eu3ZqlREpT|G) znUPtfeOecFl{V-CW3>w>s8OWkan}21T#ROoS_PM~9gB2L|AQV-{Odt+Zcv+I+Mxc6 zw&-+wiDPSuNk_gb)Y!F!MMJk9%T>a>o4c(I9{cG+0^lE+PUy^bU2<_%D_c*E+dk~( z<(hpcySb0eD?{aN-A;3j*Sfao()E>#-|vPL+?T4f2o*K98b0nSJ5lw83s1>#Nm>4` u6_%wBG_CrFZb0k7snve{eNX+=8{oTk$wAY~D}`U_%YgBF`OFf&7rX&9Q=aeu literal 0 HcmV?d00001 diff --git a/tests/requirements.txt b/tests/requirements.txt new file mode 100644 index 00000000..aec3ae28 --- /dev/null +++ b/tests/requirements.txt @@ -0,0 +1,2 @@ +pytest +lxml diff --git a/tests/test_schema.py b/tests/test_schema.py new file mode 100644 index 00000000..dbf94a74 --- /dev/null +++ b/tests/test_schema.py @@ -0,0 +1,10 @@ +from lxml import etree +import pathlib + +here = pathlib.Path(__file__).resolve().parent + + +def test_schema(): + # Checks that the schema is valid xsd + xmlschema_doc = etree.parse(str(here / '..' / 'schemas' / 'HPXML.xsd')) + xmlschema = etree.XMLSchema(xmlschema_doc) # noqa: F841 From 0d4324b80b43c3df44ac27bf1f13868d716ce62c Mon Sep 17 00:00:00 2001 From: Scott Horowitz Date: Mon, 12 Jul 2021 10:53:13 -0600 Subject: [PATCH 2/2] Fix typo. --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 93abb590..fbea1e74 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,7 +6,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actiona/checkout@v2 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v2 with: