#NEWLINE# def test_alias( self ) : #NEWLINE# #INDENT# mock_response = Mock ( ) #NEWLINE# mock_response . read . return_value = six . b ( '{"status":1, "error": null}' ) #NEWLINE# with patch ( 'six.moves.urllib.request.urlopen' , return_value = mock_response ) as urlopen : #NEWLINE# #INDENT# self . mp . alias ( 'ALIAS' , 'ORIGINAL ID' ) #NEWLINE# assert ( request . consumer . log == [ ] ) #NEWLINE# assert ( urlopen . call_count == 1 ) #NEWLINE# ( ( request , ) , _ ) = urlopen . call_args #NEWLINE# assert ( request . get_full_url ( ) == 'https://api.mixpanel.com/track' ) #NEWLINE# assert ( qs ( request . data ) == qs ( 'ip=0&data=eyJldmVudCI6IiRjcmVhdGVfYWxpYXMiLCJwcm9wZXJ0aWVzIjp7ImFsaWFzIjoiQUxJQVMiLCJ0b2tlbiI6IjEyMzQ1IiwiZGlzdGluY3RfaWQiOiJPUklHSU5BTCBJRCJ9fQ%3D%3D&verbose=1' ) )