def test_reconciling_component_approvals_with_conflicts1(mock_hub_instance): # single component with multiple approvals that conflict hub_instance = mock_hub_instance() casef = CodeCenterComponentImport("a_file_name", hub_instance) with open('test-conflicts1.csv') as csvfile: reader = csv.DictReader(csvfile, delimiter='|') rows = [r for r in reader] with pytest.raises(ApprovalStatusConflict) as e_info: casef._reconcile_component_approvals("slf4j-nop:2.0", rows)
def test_get_protex_info(mock_hub_instance): hub_instance = mock_hub_instance() casef = CodeCenterComponentImport("a_file_name", hub_instance) with open('test-get-protex-info.csv') as csvfile: reader = csv.DictReader(csvfile, delimiter='|') row1 = next(reader) component_id, version_id, approval_status = casef._get_protex_info( row1) assert component_id == 'angularxqrcode3444828' assert version_id == '13663706' assert approval_status == 'APPROVED'
def test_reconciling_component_approvals_with_approved1(mock_hub_instance): # single component with multiple approvals that conflict hub_instance = mock_hub_instance() casef = CodeCenterComponentImport("a_file_name", hub_instance) with open('test-approved1.csv') as csvfile: reader = csv.DictReader(csvfile, delimiter='|') rows = [r for r in reader] suite_component_info = casef._reconcile_component_approvals( "angularx-qrcode:1.2.4", rows) assert suite_component_info['approval_status'] == 'APPROVED' assert suite_component_info['component_name'] == 'angularx-qrcode' assert suite_component_info['component_version'] == '1.2.4'
def test_construction(mock_hub_instance): hub_instance = mock_hub_instance() casef = CodeCenterComponentImport("a_file_name", hub_instance) assert casef.component_approval_status_export_file == "a_file_name" assert casef.hub_instance == hub_instance