#NEWLINE# def test_grant_access_token( ) : #NEWLINE# #INDENT# resp = AuthorizationResponse ( code = 'code' , state = 'state' ) #NEWLINE# grant = Grant ( ) #NEWLINE# grant . add_code ( resp ) #NEWLINE# atr = AccessTokenResponse ( access_token = '2YotnFZFEjr1zCsicMWpAA' , token_type = 'example' , refresh_token = 'tGzv3JOkF0XG5Qx2TlKWIA' , example_parameter = 'example_value' , scope = [ 'inner' , 'outer' ] ) #NEWLINE# grant . add_token ( atr ) #NEWLINE# assert ( len ( grant . tokens ) == 1 ) #NEWLINE# token = grant . tokens [ 0 ] #NEWLINE# assert ( token . is_valid ( ) is True ) #NEWLINE# assert ( str ( grant ) != '' )