#NEWLINE# def test_build_and_encode_params( self ) : #NEWLINE# #INDENT# et = EventTracker ( ) #NEWLINE# event = 'foo_event' #NEWLINE# test = True #NEWLINE# properties = { #NEWLINE# #INDENT# 'token' : 'testtoken' , #NEWLINE# #UNINDENT# } #NEWLINE# params = { #NEWLINE# #INDENT# 'event' : event , #NEWLINE# 'properties' : properties , #NEWLINE# #UNINDENT# } #NEWLINE# params = et . _build_params ( event , properties ) #NEWLINE# url_params = et . _encode_params ( params , test ) #NEWLINE# expected_params = urllib . parse . urlencode ( { #NEWLINE# #INDENT# 'data' : base64 . b64encode ( json . dumps ( params ) . encode ( 'utf8' ) ) , #NEWLINE# 'test' : '1' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( expected_params , url_params )