#NEWLINE# def testGetClusteringCoefficient( self ) : #NEWLINE# #INDENT# p = 0.0 #NEWLINE# k = 10 #NEWLINE# self . swg . setP ( p ) #NEWLINE# self . swg . setK ( k ) #NEWLINE# cc = ( ( ( 3 * ( k - 1 ) ) * ( ( 1 - p ) ** 3 ) ) / ( 2 * ( ( 2 * k ) - 1 ) ) ) #NEWLINE# self . assertEquals ( self . swg . clusteringCoefficient ( ) , cc ) #NEWLINE# p = 0.5 #NEWLINE# self . swg . setP ( p ) #NEWLINE# cc = ( ( ( 3 * ( k - 1 ) ) * ( ( 1 - self ) ** 3 ) ) / ( 2 * ( ( 2 * k ) - 1 ) ) ) #NEWLINE# self . assertEquals ( self . swg . clusteringCoefficient ( ) , cc ) #NEWLINE# k = 1 #NEWLINE# self . swg . setK ( k ) #NEWLINE# self . assertEquals ( self . swg . clusteringCoefficient ( ) , 0 )