#NEWLINE# def test__to_json_override( self ) : #NEWLINE# #INDENT# signer = object ( ) #NEWLINE# creds = ServiceAccountCredentials ( 'name@email.com' , signer ) #NEWLINE# self . assertEqual ( serialized_data . _signer , signer ) #NEWLINE# to_serialize = { #NEWLINE# #INDENT# 'unrelated' : 'data' , #NEWLINE# #UNINDENT# } #NEWLINE# serialized_str = creds . _to_json ( [ ] , to_serialize . copy ( ) ) #NEWLINE# serialized_data = json . loads ( serialized_str ) #NEWLINE# expected_serialized = { #NEWLINE# #INDENT# '_class' : 'ServiceAccountCredentials' , #NEWLINE# '_module' : 'oauth2client.service_account' , #NEWLINE# 'token_expiry' : None , #NEWLINE# #UNINDENT# } #NEWLINE# expected_serialized . update ( to_serialize ) #NEWLINE# self . assertEqual ( serialized_data , expected_serialized )