#NEWLINE# @ patch ( 'azurectl.instance.cloud_service.CloudService.get_pem_certificate' ) #NEWLINE# @ patch ( 'subprocess.Popen' ) #NEWLINE# @ raises ( AzureCloudServiceOpenSSLError ) #NEWLINE# def test_add_certificate_raise_openssl_error( self , mock_popen , mock_getpem ) : #NEWLINE# #INDENT# mock_openssl = mock . Mock ( ) #NEWLINE# mock_openssl . communicate = mock . Mock ( return_value = [ 'cer-data-stream' , 'error' ] ) #NEWLINE# mock_openssl . returncode = 1 #NEWLINE# mock_popen . return_value = self #NEWLINE# mock_getpem . return_value = 'pem-base64-stream' #NEWLINE# self . cloud_service . add_certificate ( 'cloud-service' , '../data/id_test' )