Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
SA3
SA3LI Trial
Commits
89394fa0
Commit
89394fa0
authored
Mar 06, 2020
by
canterburym
Browse files
Adds XSD test fixture
parent
30312d95
Changes
2
Show whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
89394fa0
...
@@ -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
testing/check_xsd.py
0 → 100644
View file @
89394fa0
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment