#NEWLINE# def test_z_score( self ) : #NEWLINE# #INDENT# map_ = { #NEWLINE# #INDENT# 'x' : ( 182 , 35 ) , #NEWLINE# 'a' : ( 180 , 45 ) , #NEWLINE# 'b' : ( 189 , 28 ) , #NEWLINE# 'c' : ( 188 , 61 ) , #NEWLINE# 'd' : ( 188 , 188 ) , #NEWLINE# 'e' : ( 188 , 214 ) , #NEWLINE# 'f' : ( 188 , 215 ) , #NEWLINE# #UNINDENT# } #NEWLINE# e = Mock ( ) #NEWLINE# e . control = 'x' #NEWLINE# e . participants_for = ( lambda x : map_ [ x ] [ 0 ] ) #NEWLINE# e . conversions_for = ( lambda x : map_ [ x ] [ 1 ] ) #NEWLINE# v = VariantStat ( 'x' , e ) #NEWLINE# assert ( v . z_score == 'N/A' ) #NEWLINE# v = VariantStat ( 'a' , e ) #NEWLINE# assert ( round ( v . z_score , 3 ) == 1.325 ) #NEWLINE# v = VariantStat ( 'b' , e ) #NEWLINE# assert ( round ( v . z_score , 3 ) == ( - 1.132 ) ) #NEWLINE# v = VariantStat ( 'c' , e ) #NEWLINE# assert ( round ( v . z_score , 3 ) == 2.941 ) #NEWLINE# v = VariantStat ( 'd' , e ) #NEWLINE# assert ( round ( v . z_score , 3 ) == 27.648 ) #NEWLINE# v = VariantStat ( 'e' , e ) #NEWLINE# assert ( round ( v . z_score , 3 ) == 235.953 ) #NEWLINE# v = VariantStat ( 'f' , e ) #NEWLINE# assert ( v . z_score == 'Invalid' )