#NEWLINE# def test_set_kpi( self ) : #NEWLINE# #INDENT# exp = Experiment . find_or_create ( 'multi-kpi' , [ 'kpi' , '123' ] , redis = self . redis ) #NEWLINE# with self . assertRaises ( ValueError ) : #NEWLINE# #INDENT# exp . set_kpi ( 'bananza' ) #NEWLINE# #UNINDENT# client = Client ( 100 , redis = self . redis ) #NEWLINE# exp . get_alternative ( client ) #NEWLINE# exp . convert ( client , None , 'bananza' ) #NEWLINE# exp2 = Experiment . find_or_create ( 'multi-kpi' , [ 'kpi' , '123' ] , redis = self . redis ) #NEWLINE# self . assertEqual ( exp2 . kpi , None ) #NEWLINE# exp2 . set_kpi ( 'bananza' ) #NEWLINE# self . assertEqual ( exp2 . kpi , 'bananza' )