def test_cc_bad_ratio():
 ratio = (-1.0)
 cc = ClusterCentroids(ratio=ratio, random_state=RND_SEED)
 assert_raises(ValueError, cc.fit, X, Y)
 ratio = 100.0
 cc = ClusterCentroids(ratio=ratio, random_state=RND_SEED)
 assert_raises(ValueError, cc.fit, X, Y)
 ratio = 'rnd'
 cc = ClusterCentroids(ratio=ratio, random_state=RND_SEED)
 assert_raises(ValueError, cc.fit, X, Y)
 ratio = [0.5, 0.5]
 cc = ClusterCentroids(ratio=ratio, random_state=RND_SEED)
 assert_raises(ValueError, cc.fit, X, Y)

def test_cc_bad_ratio ( ) : ratio = ( - 1.0 ) cc = ClusterCentroids ( ratio = ratio , random_state = RND_SEED ) assert_raises ( ValueError , cc . fit , X , Y ) ratio = 100.0 cc = ClusterCentroids ( ratio = ratio , random_state = RND_SEED ) assert_raises ( ValueError , cc . fit , X , Y ) ratio = 'rnd' cc = ClusterCentroids ( ratio = ratio , random_state = RND_SEED ) assert_raises ( ValueError , cc . fit , X , Y ) ratio = [ 0.5 , 0.5 ] cc = ClusterCentroids ( ratio = ratio , random_state = RND_SEED ) assert_raises ( ValueError , cc . fit , X , Y )
test either if an error is raised with a wrong decimal value for the ratio .