File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -476,12 +476,13 @@ def test_api_product_endpoint_import_from_scan_action(self):
476476 self .assertEqual (expected , response .data )
477477
478478 scan_input_location = self .testfiles_path / "import_from_scan.json"
479- data = {
480- "upload_file" : scan_input_location .open (),
481- "create_codebase_resources" : True ,
482- "stop_on_error" : False ,
483- }
484- response = self .client .post (url , data )
479+ with scan_input_location .open () as upload_file :
480+ data = {
481+ "upload_file" : upload_file ,
482+ "create_codebase_resources" : True ,
483+ "stop_on_error" : False ,
484+ }
485+ response = self .client .post (url , data )
485486 self .assertEqual (status .HTTP_200_OK , response .status_code )
486487 expected = {
487488 "status" : "Imported from Scan: 1 Packages, 1 Product Packages, 3 Codebase Resources"
You can’t perform that action at this time.
0 commit comments