def test_ros_bad_ratio():
 ratio = (-1.0)
 ros = RandomOverSampler(ratio=ratio, random_state=RND_SEED)
 assert_raises(ValueError, ros.fit_sample, X, Y)
 ratio = 100.0
 ros = RandomOverSampler(ratio=ratio, random_state=RND_SEED)
 assert_raises(ValueError, ros.fit_sample, X, Y)
 ratio = 'rnd'
 ros = RandomOverSampler(ratio=ratio, random_state=RND_SEED)
 assert_raises(ValueError, ros.fit_sample, X, Y)
 ratio = [0.5, 0.5]
 ros = RandomOverSampler(ratio=ratio, random_state=RND_SEED)
 assert_raises(ValueError, ros.fit_sample, X, Y)

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