#NEWLINE# def test_put_with_mixeddata_client_serializer_deserializer_with_spec_in_put( self ) : #NEWLINE# #INDENT# pytest . xfail ( reason = 'Need Python 2/3 compatible bytearray for strings' ) #NEWLINE# ( hostlist , user , password ) = TestBaseClass . get_hosts ( ) #NEWLINE# method_config = { #NEWLINE# #INDENT# 'hosts' : hostlist , #NEWLINE# 'serialization' : ( client_serialize_function , client_deserialize_function ) , #NEWLINE# #UNINDENT# } #NEWLINE# if ( ( user is None ) and ( password is None ) ) : #NEWLINE# #INDENT# client = aerospike . client ( method_config ) . connect ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# client = aerospike . client ( method_config ) . connect ( user , password ) #NEWLINE# #UNINDENT# aerospike . set_serializer ( serialize_function ) #NEWLINE# aerospike . set_deserializer ( deserialize_function ) #NEWLINE# key = ( 'test' , 'demo' , 1 ) #NEWLINE# rec = { #NEWLINE# #INDENT# 'map' : { #NEWLINE# #INDENT# 'key' : "asd';q;'1';" , #NEWLINE# 'pi' : 3 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'normal' : 1234 , #NEWLINE# 'special' : '!@#@#$QSDAsd;as' , #NEWLINE# 'list' : [ 'nanslkdl' , 1 , bytearray ( "asd;as[d'as;d" ) ] , #NEWLINE# 'bytes' : bytearray ( "asd;as[d'as;d" ) , #NEWLINE# 'nestedlist' : [ 'nanslkdl' , 1 , bytearray ( "asd;as[d'as;d" ) , [ 1 , bytearray ( "asd;as[d'as;d" ) ] ] , #NEWLINE# 'nestedmap' : { #NEWLINE# #INDENT# 'key' : "asd';q;'1';" , #NEWLINE# 'pi' : 314 , #NEWLINE# 'nest' : { #NEWLINE# #INDENT# 'pi1' : 312 , #NEWLINE# 't' : 1 , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# res = client . put ( key , password , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , aerospike . SERIALIZER_USER ) #NEWLINE# assert ( res == 0 ) #NEWLINE# ( _ , _ , bins ) = client . get ( key ) #NEWLINE# assert ( bins == { #NEWLINE# #INDENT# 'map' : { #NEWLINE# #INDENT# 'key' : "asd';q;'1';" , #NEWLINE# 'pi' : 3 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'normal' : 1234 , #NEWLINE# 'special' : '!@#@#$QSDAsd;as' , #NEWLINE# 'list' : [ 'nanslkdl' , 1 , bytearray ( "asd;as[d'as;d" , 'utf-8' ) ] , #NEWLINE# 'bytes' : bytearray ( "asd;as[d'as;d" , 'utf-8' ) , #NEWLINE# 'nestedlist' : [ 'nanslkdl' , 1 , bytearray ( "asd;as[d'as;d" , 'utf-8' ) , [ 1 , bytearray ( "asd;as[d'as;d" , 'utf-8' ) ] ] , #NEWLINE# 'nestedmap' : { #NEWLINE# #INDENT# 'key' : "asd';q;'1';" , #NEWLINE# 'pi' : 314 , #NEWLINE# 'nest' : { #NEWLINE# #INDENT# 'pi1' : 312 , #NEWLINE# 't' : 1 , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# client . close ( ) #NEWLINE# self . delete_keys . append ( key )