#NEWLINE# def _from_p12_keyfile_helper( self , private_key_password = None , scopes = '' ) : #NEWLINE# #INDENT# service_account_email = 'name@email.com' #NEWLINE# filename = data_filename ( 'privatekey.p12' ) #NEWLINE# with open ( filename , 'rb' ) as file_obj : #NEWLINE# #INDENT# key_contents = file_obj . read ( ) #NEWLINE# #UNINDENT# creds = ServiceAccountCredentials . from_p12_keyfile ( service_account_email , filename , private_key_password = private_key_password , scopes = scopes ) #NEWLINE# self . assertIsInstance ( creds , ServiceAccountCredentials ) #NEWLINE# self . assertIsNone ( creds . client_id ) #NEWLINE# self . assertEqual ( creds . _service_account_email , service_account_email ) #NEWLINE# self . assertIsNone ( creds . _private_key_id ) #NEWLINE# self . assertIsNone ( key_contents . _private_key_pkcs8_pem ) #NEWLINE# self . assertEqual ( creds . _private_key_pkcs12 , key_contents ) #NEWLINE# if ( private_key_password is not None ) : #NEWLINE# #INDENT# self . assertEqual ( creds . _private_key_password , private_key_password ) #NEWLINE# #UNINDENT# self . assertEqual ( creds . _scopes , ' ' . join ( scopes ) )