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

Correcting validation

parent a9edda0e
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</ns1:targetIdentifiers> </ns1:targetIdentifiers>
<ns1:deliveryType>X2andX3</ns1:deliveryType> <ns1:deliveryType>X2andX3</ns1:deliveryType>
<ns1:listOfDIDs> <ns1:listOfDIDs>
<ns1:dId>1eb4406a-8b28-41fd-8f0f-e1a0a3eb5ff9foooo</ns1:dId> <ns1:dId>1eb4406a-8b28-41fd-8f0f-e1a0a3eb5ff9</ns1:dId>
</ns1:listOfDIDs> </ns1:listOfDIDs>
</ns1:taskDetails> </ns1:taskDetails>
<ns1:taskStatus> <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 @@ ...@@ -20,5 +20,29 @@
"exampleFiles" : [ "exampleFiles" : [
"103221-1/examples" "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__': ...@@ -141,7 +141,7 @@ if __name__ == '__main__':
logging.debug(f"Adding supporting schema {supportSchema}") logging.debug(f"Adding supporting schema {supportSchema}")
try: try:
xs = XMLSchema(supportSchema, validation='skip') 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)) logging.info(" [ {0} -> {1} ]".format(xs.default_namespace, supportSchema))
except Exception as ex: except Exception as ex:
logging.warning (" [ {0} exception parsing: {1} ]".format(supportSchema, ex)) logging.warning (" [ {0} exception parsing: {1} ]".format(supportSchema, ex))
...@@ -176,7 +176,7 @@ if __name__ == '__main__': ...@@ -176,7 +176,7 @@ if __name__ == '__main__':
logging.info (f"Validating example {len(target['exampleFiles'])} entries for {target['coreSchema']}") logging.info (f"Validating example {len(target['exampleFiles'])} entries for {target['coreSchema']}")
for example in target["exampleFiles"]: for example in target["exampleFiles"]:
examplePath = Path(example) examplePath = Path(example)
if examplePath.is_dir: if examplePath.is_dir():
logging.debug (f"Expanding {str(examplePath)}") logging.debug (f"Expanding {str(examplePath)}")
testFiles = list(examplePath.rglob("./*.xml")) testFiles = list(examplePath.rglob("./*.xml"))
else: else:
...@@ -203,8 +203,13 @@ if __name__ == '__main__': ...@@ -203,8 +203,13 @@ if __name__ == '__main__':
totalErrors = 0 totalErrors = 0
for filename, result in results.items(): for filename, result in results.items():
print (f"{filename:.<70}{'..OK' if result['ok'] else 'FAIL'}") 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'] totalErrors += result['failureCount']
if result['failureCount'] > 0:
for testFile, testResult in result['testResults'].items(): for testFile, testResult in result['testResults'].items():
print(f" {str(testFile):.<65}{'..OK' if len(testResult) == 0 else 'FAIL'}") print(f" {str(testFile):.<65}{'..OK' if len(testResult) == 0 else 'FAIL'}")
for tr in testResult: for tr in testResult:
......
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