|
78 | 78 | RelatedCryptoMaterialState,
|
79 | 79 | RelatedCryptoMaterialType,
|
80 | 80 | )
|
81 |
| -from cyclonedx.model.definition import Definitions, Standard |
| 81 | +from cyclonedx.model.definition import CreId, Definitions, Level, Requirement, Standard |
82 | 82 | from cyclonedx.model.dependency import Dependency
|
83 | 83 | from cyclonedx.model.impact_analysis import (
|
84 | 84 | ImpactAnalysisAffectedStatus,
|
@@ -1310,6 +1310,51 @@ def get_bom_with_definitions_standards() -> Bom:
|
1310 | 1310 | )
|
1311 | 1311 |
|
1312 | 1312 |
|
| 1313 | +def get_bom_with_definitions_and_detailed_standards() -> Bom: |
| 1314 | + """ |
| 1315 | + Returns a BOM with definitions and multiple detailed standards including requirements and levels. |
| 1316 | + """ |
| 1317 | + return _make_bom( |
| 1318 | + definitions=Definitions( |
| 1319 | + standards=[ |
| 1320 | + Standard(name='Some Standard', version='1.2.3', description='Some description', bom_ref='some-standard', |
| 1321 | + owner='Some Owner', external_references=[get_external_reference_1()], |
| 1322 | + requirements=[ |
| 1323 | + Requirement(identifier='REQ-1', title='Requirement 1', text='some requirement text', |
| 1324 | + bom_ref='req-1', descriptions=['Requirement 1 described here', 'and here'], |
| 1325 | + open_cre=[CreId('CRE:1-2')], properties=[Property(name='key1', value='val1')] |
| 1326 | + ), |
| 1327 | + Requirement(identifier='REQ-2', title='Requirement 2', text='some requirement text', |
| 1328 | + bom_ref='req-2', descriptions=['Requirement 2 described here'], |
| 1329 | + open_cre=[CreId('CRE:1-2'), CreId('CRE:3-4')], |
| 1330 | + properties=[Property(name='key2', value='val2')], |
| 1331 | + parent='req-1' |
| 1332 | + ), |
| 1333 | + ], |
| 1334 | + levels=[ |
| 1335 | + Level(identifier='LVL-1', title='Level 1', description='Level 1 description', |
| 1336 | + bom_ref='lvl-1', ), |
| 1337 | + Level(identifier='LVL-2', title='Level 2', description='Level 2 description', |
| 1338 | + bom_ref='lvl-2', ) |
| 1339 | + ]), |
| 1340 | + Standard(name='Other Standard', version='1.0.0', description='Other description', |
| 1341 | + bom_ref='other-standard', owner='Other Owner', |
| 1342 | + external_references=[get_external_reference_2()], |
| 1343 | + requirements=[ |
| 1344 | + Requirement(identifier='REQ-3', title='Requirement 3', text='some requirement text', |
| 1345 | + bom_ref='req-3', descriptions=['Requirement 3 described here', 'and here'], |
| 1346 | + open_cre=[CreId('CRE:5-6'), CreId('CRE:7-8')], |
| 1347 | + properties=[Property(name='key3', value='val3')] |
| 1348 | + ) |
| 1349 | + ], |
| 1350 | + levels=[ |
| 1351 | + Level(identifier='LVL-3', title='Level 3', description='Level 3 description', |
| 1352 | + bom_ref='lvl-3', ) |
| 1353 | + ]) |
| 1354 | + ] |
| 1355 | + )) |
| 1356 | + |
| 1357 | + |
1313 | 1358 | # ---
|
1314 | 1359 |
|
1315 | 1360 |
|
@@ -1357,4 +1402,5 @@ def get_bom_with_definitions_standards() -> Bom:
|
1357 | 1402 | get_bom_for_issue_630_empty_property,
|
1358 | 1403 | get_bom_with_lifecycles,
|
1359 | 1404 | get_bom_with_definitions_standards,
|
| 1405 | + get_bom_with_definitions_and_detailed_standards, |
1360 | 1406 | }
|
0 commit comments