Commit 3adbf765 authored by canterburym's avatar canterburym
Browse files

Correcting validation

parent a9edda0e
......@@ -16,7 +16,7 @@
</ns1:targetIdentifiers>
<ns1:deliveryType>X2andX3</ns1:deliveryType>
<ns1:listOfDIDs>
<ns1:dId>1eb4406a-8b28-41fd-8f0f-e1a0a3eb5ff9foooo</ns1:dId>
<ns1:dId>1eb4406a-8b28-41fd-8f0f-e1a0a3eb5ff9</ns1:dId>
</ns1:listOfDIDs>
</ns1:taskDetails>
<ns1:taskStatus>
......
Mod1 {itu-t(0) identified-organization(4) etsi(0)}
DEFINITIONS ::=
BEGIN
IMPORTS
ImportedField,
ClashField
FROM Mod2 {itu-t(0) identified-organization(4) etsi(1)};
TestPDU ::= SEQUENCE
{
field1 [1] ClashField
}
ClashField ::= BOOLEAN
END
Mod2 {itu-t(0) identified-organization(4) etsi(1)}
DEFINITIONS ::=
BEGIN
ImportedField ::= SEQUENCE
{
field2 [0] BOOLEAN
}
ClashField ::= INTEGER
END
......@@ -20,5 +20,29 @@
"exampleFiles" : [
"103221-1/examples"
]
},
{
"coreSchema" : "103120/dictionaries/ts_103120_Dictionaries.xsd",
"supportingSchemas" : [],
"exampleFiles" : [
"103120/dictionaries/ts_103120_ETSIDictionaryDefinitions.xml"
]
},
{
"coreSchema" : "103120/schema/ts_103120_Core.xsd",
"supportingSchemas" : [
"103120/schema/ts_103120_Authorisation.xsd",
"103120/schema/ts_103120_Common.xsd",
"103120/schema/ts_103120_Delivery.xsd",
"103120/schema/ts_103120_Document.xsd",
"103120/schema/ts_103120_Notification.xsd",
"103120/schema/ts_103120_Task.xsd",
"103280/TS_103_280.xsd",
"testing/deps/xmldsig/xmldsig-core-schema.xsd",
"103120/examples/FooServiceSchema.xsd"
],
"exampleFiles" : [
"103120/examples"
]
}
]
\ No newline at end of file
......@@ -141,7 +141,7 @@ if __name__ == '__main__':
logging.debug(f"Adding supporting schema {supportSchema}")
try:
xs = XMLSchema(supportSchema, validation='skip')
schemaLocations.append((xs.default_namespace, str(Path(supportSchema).resolve())))
schemaLocations.append((xs.target_namespace, str(Path(supportSchema).resolve())))
logging.info(" [ {0} -> {1} ]".format(xs.default_namespace, supportSchema))
except Exception as ex:
logging.warning (" [ {0} exception parsing: {1} ]".format(supportSchema, ex))
......@@ -176,7 +176,7 @@ if __name__ == '__main__':
logging.info (f"Validating example {len(target['exampleFiles'])} entries for {target['coreSchema']}")
for example in target["exampleFiles"]:
examplePath = Path(example)
if examplePath.is_dir:
if examplePath.is_dir():
logging.debug (f"Expanding {str(examplePath)}")
testFiles = list(examplePath.rglob("./*.xml"))
else:
......@@ -203,12 +203,17 @@ if __name__ == '__main__':
totalErrors = 0
for filename, result in results.items():
print (f"{filename:.<70}{'..OK' if result['ok'] else 'FAIL'}")
totalErrors += result['failureCount']
for testFile, testResult in result['testResults'].items():
print(f" {str(testFile):.<65}{'..OK' if len(testResult) == 0 else 'FAIL'}")
for tr in testResult:
print(f" {tr}")
if len(result['testResults']) == 0:
print (f"{filename:.<70}SKIP (0)")
continue
else:
print (f"{filename:.<70}{'..OK' if result['ok'] else 'FAIL'} ({len(result['testResults'])})")
totalErrors += result['failureCount']
if result['failureCount'] > 0:
for testFile, testResult in result['testResults'].items():
print(f" {str(testFile):.<65}{'..OK' if len(testResult) == 0 else 'FAIL'}")
for tr in testResult:
print(f" {tr}")
print(f"{'-':-<75}")
print(f"Validation errors: {totalErrors}")
......
Supports Markdown
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