#NEWLINE# def test_mutate_function( self ) : #NEWLINE# #INDENT# ' Check that the individual is not the same after mutation\n            Check that only one bit in the individual is changed ' #NEWLINE# individual = [ 0 , 1 , 1 , 0 , 1 ] #NEWLINE# self . ga . mutate_function ( individual ) #NEWLINE# res = [ ( x == y ) for ( x , y ) in zip ( res , [ 0 , 1 , 1 , 0 , 1 ] ) ] #NEWLINE# assert ( individual != [ 0 , 1 , 1 , 0 , 1 ] ) #NEWLINE# assert ( res . count ( False ) == 1 )