File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -2443,7 +2443,7 @@ class ExportOpenVEXView(
24432443 def get (self , request , * args , ** kwargs ):
24442444 product = self .get_object ()
24452445 openvex_document_json = outputs .get_openvex_document_json (product )
2446- filename = outputs .get_filename (product , extension = "openvex.json " )
2446+ filename = outputs .get_filename (product , extension = "openvex" )
24472447
24482448 return outputs .get_attachment_response (
24492449 file_content = openvex_document_json ,
Original file line number Diff line number Diff line change @@ -3098,6 +3098,20 @@ def test_product_portfolio_product_export_cyclonedx_view(self):
30983098 self .assertIn ("vulnerabilities" , response_str )
30993099 self .assertIn (vulnerability1 .vulnerability_id , response_str )
31003100
3101+ def test_product_portfolio_product_export_openvex_view (self ):
3102+ self .client .login (username = self .super_user .username , password = "secret" )
3103+ export_openvex_url = self .product1 .get_export_openvex_url ()
3104+ response = self .client .get (export_openvex_url )
3105+ self .assertEqual (
3106+ "dejacode_nexb_product_product1_with_space_1.0.openvex.json" , response .filename
3107+ )
3108+ self .assertEqual ("application/json" , response .headers ["Content-Type" ])
3109+
3110+ content = io .BytesIO (b"" .join (response .streaming_content ))
3111+ bom_as_dict = json .loads (content .read ().decode ("utf-8" ))
3112+ self .assertEqual ("https://openvex.dev/ns/v0.2.0" , bom_as_dict ["@context" ])
3113+ self .assertEqual (self .dataspace .name , bom_as_dict ["author" ])
3114+
31013115 @mock .patch ("dejacode_toolkit.scancodeio.ScanCodeIO.submit_project" )
31023116 def test_product_portfolio_load_sbom_view (self , mock_submit ):
31033117 mock_submit .return_value = None
You can’t perform that action at this time.
0 commit comments