Coverage for pyEDAA/Reports/Resources/OpenTestReporting/__init__.py: 100%

18 statements  

« prev     ^ index     » next       coverage.py v7.16.2, created at 2026-10-21 23:49 +0000

1# ==================================================================================================================== # 

2# _____ ____ _ _ ____ _ # 

3# _ __ _ _| ____| _ \ / \ / \ | _ \ ___ _ __ ___ _ __| |_ ___ # 

4# | '_ \| | | | _| | | | |/ _ \ / _ \ | |_) / _ \ '_ \ / _ \| '__| __/ __| # 

5# | |_) | |_| | |___| |_| / ___ \ / ___ \ _| _ < __/ |_) | (_) | | | |_\__ \ # 

6# | .__/ \__, |_____|____/_/ \_\/_/ \_(_)_| \_\___| .__/ \___/|_| \__|___/ # 

7# |_| |___/ |_| # 

8# ==================================================================================================================== # 

9# Authors: # 

10# Patrick Lehmann # 

11# # 

12# License: # 

13# ==================================================================================================================== # 

14# Copyright 2026-2026 Electronic Design Automation Abstraction (EDA²) # 

15# # 

16# Licensed under the Apache License, Version 2.0 (the "License"); # 

17# you may not use this file except in compliance with the License. # 

18# You may obtain a copy of the License at # 

19# # 

20# http://www.apache.org/licenses/LICENSE-2.0 # 

21# # 

22# Unless required by applicable law or agreed to in writing, software # 

23# distributed under the License is distributed on an "AS IS" BASIS, # 

24# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # 

25# See the License for the specific language governing permissions and # 

26# limitations under the License. # 

27# # 

28# SPDX-License-Identifier: Apache-2.0 # 

29# ==================================================================================================================== # 

30# 

31""" 

32A resource package containing the XML schemas of Open Test Reporting. 

33 

34`Open Test Reporting <https://github.com/ota4j-team/open-test-reporting>`__ publishes an XML schema per namespace. The 

35schemas of version 0.2.0 are copies of the files in the project's :file:`schema/src/main/resources` directory (release 

36r0.2.7), licensed under the Apache License 2.0. Each is shown, with its source, on the 

37:ref:`schema page <SCHEMAS/OpenTestReporting>`. 

38 

39* :file:`OpenTestReporting-0.2.0.xsd` - imports the schemas below and validates both formats, used by 

40 :class:`pyEDAA.Reports.Unittesting.OpenTestReporting.Events.Document` and 

41 :class:`pyEDAA.Reports.Unittesting.OpenTestReporting.Hierarchy.Document`. 

42* :file:`core-0.2.0.xsd` - elements shared by both formats (copy). 

43* :file:`events-0.2.0.xsd` - the event-based format (copy). 

44* :file:`hierarchy-0.2.0.xsd` - the hierarchical format (copy). 

45* :file:`java-0.2.0.xsd` - the Java extension (copy). 

46* :file:`git-0.2.0.xsd` - the Git extension (copy). 

47* :file:`JUnit.xsd` - the JUnit Platform's extension (metadata of a test or container). 

48 

49:data:`SPECIFICATIONS` names, per version of Open Test Reporting, each XML namespace and the schema defining it. 

50""" 

51from __future__ import annotations 

52 

53from typing import Dict, NamedTuple 

54 

55from pyTooling.Decorators import export 

56 

57 

58__all__ = ["SPECIFICATIONS"] 

59 

60 

61@export 

62class Namespace(NamedTuple): 

63 """An XML namespace of Open Test Reporting and the XML schema in this resource package defining it.""" 

64 

65 URI: str #: The namespace's URI, e.g. ``https://schemas.opentest4j.org/reporting/core/0.2.0``. 

66 SchemaFile: str #: The XML schema defining the namespace, e.g. :file:`core-0.2.0.xsd`. 

67 

68 

69@export 

70class Specification(NamedTuple): 

71 """The XML namespaces of one version of Open Test Reporting, and the XML schema importing them all.""" 

72 

73 SchemaFile: str #: The XML schema importing the schemas of all namespaces, validating both formats. 

74 Core: Namespace #: Elements shared by both formats. 

75 Events: Namespace #: The event-based format. 

76 Hierarchy: Namespace #: The hierarchical format. 

77 Java: Namespace #: The Java extension. 

78 Git: Namespace #: The Git extension. 

79 JUnit: Namespace #: The JUnit Platform's extension. 

80 

81 

82SPECIFICATIONS: Dict[str, Specification] = { 

83 "0.2.0": Specification( 

84 SchemaFile="OpenTestReporting-0.2.0.xsd", 

85 Core= Namespace("https://schemas.opentest4j.org/reporting/core/0.2.0", "core-0.2.0.xsd"), 

86 Events= Namespace("https://schemas.opentest4j.org/reporting/events/0.2.0", "events-0.2.0.xsd"), 

87 Hierarchy= Namespace("https://schemas.opentest4j.org/reporting/hierarchy/0.2.0", "hierarchy-0.2.0.xsd"), 

88 Java= Namespace("https://schemas.opentest4j.org/reporting/java/0.2.0", "java-0.2.0.xsd"), 

89 Git= Namespace("https://schemas.opentest4j.org/reporting/git/0.2.0", "git-0.2.0.xsd"), 

90 JUnit= Namespace("https://schemas.junit.org/open-test-reporting", "JUnit.xsd") 

91 ) 

92} #: Per version of Open Test Reporting, its XML namespaces and schemas.