#NEWLINE# def setUp( self ) : #NEWLINE# #INDENT# mocker = requests_mock . Mocker ( ) #NEWLINE# mocker . post ( 'https://www.linkedin.com/uas/oauth2/accessToken' , json = { #NEWLINE# #INDENT# 'access_token' : 'linkedin' , #NEWLINE# #UNINDENT# } ) #NEWLINE# mocker . post ( 'https://api.linkedin.com/v1/people/~/shares' , status_code = 201 , json = { #NEWLINE# #INDENT# 'updateKey' : 'UPDATE-3346389-595113200' , #NEWLINE# 'updateUrl' : 'https://www.linkedin.com/updates?discuss=abc&scope=xyz' , #NEWLINE# #UNINDENT# } ) #NEWLINE# mocker . start ( ) #NEWLINE# self . addCleanup ( mocker . stop ) #NEWLINE# linkedin = OAuth2Session ( 'foo' , redirect_uri = 'https://i.b' ) #NEWLINE# self . session = linkedin_compliance_fix ( linkedin )