Commit 89394fa0 authored by canterburym's avatar canterburym

Adds XSD test fixture

parent 30312d95
...@@ -6,8 +6,14 @@ before_script: ...@@ -6,8 +6,14 @@ before_script:
stages: stages:
- Check ASN.1 - Check ASN.1
- Check XSD
checkASN1: checkASN1:
stage: Check ASN.1 stage: Check ASN.1
script: script:
- python3 testing/check_asn1.py - python3 testing/check_asn1.py
checkXSD:
stage: Check XSD
script:
- python3 testing/check_xsd.py
\ No newline at end of file
import glob
import sys
from pathlib import Path
from pprint import pprint
if __name__ == '__main__':
if sys.version_info <= (3, 5):
sys.exit('ERROR: You need at least Python 3.5 to run this tool')
try:
from lxml import etree
except ImportError:
sys.exit('ERROR: You need to install the Python lxml library')
try:
import xmlschema
except ImportError:
sys.exit('ERROR: You need to install the xml schema library')
schemaFiles = glob.glob('*.xsd')
for schemaFile in schemaFiles:
print("Checking file: {0}".format(schemaFile), end="")
xs = xmlschema.XMLSchema(schemaFile)
print("OK")
print ("{0} XSD schemas checked".format(len(schemaFiles)))
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment