#NEWLINE# def test_recolor( ) : #NEWLINE# #INDENT# wc = WordCloud ( max_words = 50 ) #NEWLINE# wc . generate ( THIS ) #NEWLINE# array_before = wc . to_array ( ) #NEWLINE# wc . recolor ( ) #NEWLINE# array_after = wc . to_array ( ) #NEWLINE# assert_array_equal ( ( array_before . sum ( axis = ( - 1 ) ) != 0 ) , ( array_after . sum ( axis = ( - 1 ) ) != 0 ) ) #NEWLINE# assert_greater ( np . abs ( ( array_before - array_after ) ) . sum ( ) , 10000 ) #NEWLINE# wc . recolor ( random_state = 10 ) #NEWLINE# wc_again = wc . to_array ( ) #NEWLINE# assert_array_equal ( wc_again , wc . recolor ( random_state = 10 ) )