|
78 | 78 | RelatedCryptoMaterialState,
|
79 | 79 | RelatedCryptoMaterialType,
|
80 | 80 | )
|
81 |
| -from cyclonedx.model.definition import DefinitionRepository, Standard |
| 81 | +from cyclonedx.model.definition import CreId, DefinitionRepository, Level, Requirement, Standard |
82 | 82 | from cyclonedx.model.dependency import Dependency
|
83 | 83 | from cyclonedx.model.impact_analysis import (
|
84 | 84 | ImpactAnalysisAffectedStatus,
|
@@ -1287,6 +1287,51 @@ def get_bom_with_definitions_standards() -> Bom:
|
1287 | 1287 | )
|
1288 | 1288 |
|
1289 | 1289 |
|
| 1290 | +def get_bom_with_definitions_and_detailed_standards() -> Bom: |
| 1291 | + """ |
| 1292 | + Returns a BOM with definitions and multiple detailed standards including requirements and levels. |
| 1293 | + """ |
| 1294 | + return _make_bom( |
| 1295 | + definitions=DefinitionRepository( |
| 1296 | + standards=[ |
| 1297 | + Standard(name='Some Standard', version='1.2.3', description='Some description', bom_ref='some-standard', |
| 1298 | + owner='Some Owner', external_references=[get_external_reference_1()], |
| 1299 | + requirements=[ |
| 1300 | + Requirement(identifier='REQ-1', title='Requirement 1', text='some requirement text', |
| 1301 | + bom_ref='req-1', descriptions=['Requirement 1 described here', 'and here'], |
| 1302 | + open_cre=[CreId('CRE:1-2')], properties=[Property(name='key1', value='val1')] |
| 1303 | + ), |
| 1304 | + Requirement(identifier='REQ-2', title='Requirement 2', text='some requirement text', |
| 1305 | + bom_ref='req-2', descriptions=['Requirement 2 described here'], |
| 1306 | + open_cre=[CreId('CRE:1-2'), CreId('CRE:3-4')], |
| 1307 | + properties=[Property(name='key2', value='val2')], |
| 1308 | + parent='req-1' |
| 1309 | + ), |
| 1310 | + ], |
| 1311 | + levels=[ |
| 1312 | + Level(identifier='LVL-1', title='Level 1', description='Level 1 description', |
| 1313 | + bom_ref='lvl-1', ), |
| 1314 | + Level(identifier='LVL-2', title='Level 2', description='Level 2 description', |
| 1315 | + bom_ref='lvl-2', ) |
| 1316 | + ]), |
| 1317 | + Standard(name='Other Standard', version='1.0.0', description='Other description', |
| 1318 | + bom_ref='other-standard', owner='Other Owner', |
| 1319 | + external_references=[get_external_reference_2()], |
| 1320 | + requirements=[ |
| 1321 | + Requirement(identifier='REQ-3', title='Requirement 3', text='some requirement text', |
| 1322 | + bom_ref='req-3', descriptions=['Requirement 3 described here', 'and here'], |
| 1323 | + open_cre=[CreId('CRE:5-6'), CreId('CRE:7-8')], |
| 1324 | + properties=[Property(name='key3', value='val3')] |
| 1325 | + ) |
| 1326 | + ], |
| 1327 | + levels=[ |
| 1328 | + Level(identifier='LVL-3', title='Level 3', description='Level 3 description', |
| 1329 | + bom_ref='lvl-3', ) |
| 1330 | + ]) |
| 1331 | + ] |
| 1332 | + )) |
| 1333 | + |
| 1334 | + |
1290 | 1335 | # ---
|
1291 | 1336 |
|
1292 | 1337 |
|
@@ -1333,4 +1378,5 @@ def get_bom_with_definitions_standards() -> Bom:
|
1333 | 1378 | get_bom_with_component_setuptools_with_v16_fields,
|
1334 | 1379 | get_bom_for_issue_630_empty_property,
|
1335 | 1380 | get_bom_with_definitions_standards,
|
| 1381 | + get_bom_with_definitions_and_detailed_standards, |
1336 | 1382 | }
|
0 commit comments