@@ -96,22 +96,10 @@ def assertEqualJsonBom(self, a: str, b: str) -> None:
9696
9797 # Unify timestamps to ensure they will compare
9898 now = datetime .now (tz = timezone .utc )
99-
10099 if 'metadata' in ab .keys ():
101100 ab ['metadata' ]['timestamp' ] = now .isoformat ()
102- if 'tools' in ab ['metadata' ].keys ():
103- for tool in ab ['metadata' ]['tools' ]:
104- if tool ['name' ] == cyclonedx_lib_name :
105- tool ['version' ] = cyclonedx_lib_version
106- del tool
107-
108101 if 'metadata' in bb .keys ():
109102 bb ['metadata' ]['timestamp' ] = now .isoformat ()
110- if 'tools' in bb ['metadata' ].keys ():
111- for tool in bb ['metadata' ]['tools' ]:
112- if tool ['name' ] == cyclonedx_lib_name :
113- tool ['version' ] = cyclonedx_lib_version
114- del tool
115103
116104 self .assertEqualJson (json .dumps (ab ), json .dumps (bb ))
117105
@@ -156,19 +144,10 @@ def assertEqualXmlBom(self, a: str, b: str, namespace: str) -> None:
156144 metadata_ts_a = ba .find ('./{{{}}}metadata/{{{}}}timestamp' .format (namespace , namespace ))
157145 if metadata_ts_a is not None :
158146 metadata_ts_a .text = now .isoformat ()
159-
160147 metadata_ts_b = bb .find ('./{{{}}}metadata/{{{}}}timestamp' .format (namespace , namespace ))
161148 if metadata_ts_b is not None :
162149 metadata_ts_b .text = now .isoformat ()
163150
164- # Align 'this' Tool Version
165- this_tool = ba .find ('.//*/{{{}}}tool[{{{}}}version="VERSION"]' .format (namespace , namespace ))
166- if this_tool is not None :
167- this_tool .find ('./{{{}}}version' .format (namespace )).text = cyclonedx_lib_version
168- this_tool = bb .find ('.//*/{{{}}}tool[{{{}}}version="VERSION"]' .format (namespace , namespace ))
169- if this_tool is not None :
170- this_tool .find ('./{{{}}}version' .format (namespace )).text = cyclonedx_lib_version
171-
172151 self .assertEqualXml (
173152 xml .etree .ElementTree .tostring (ba , 'unicode' ),
174153 xml .etree .ElementTree .tostring (bb , 'unicode' )
0 commit comments