#NEWLINE# def test_defector_wins( self ) : #NEWLINE# #INDENT# 'Does one defector win over time?' #NEWLINE# eco = axelrod . Ecosystem ( self . res_defector_wins ) #NEWLINE# eco . reproduce ( 1000 ) #NEWLINE# pops = eco . population_sizes #NEWLINE# self . assertEqual ( len ( pops ) , 1001 ) #NEWLINE# for p in pops : #NEWLINE# #INDENT# self . assertEqual ( len ( p ) , 4 ) #NEWLINE# self . assertAlmostEqual ( sum ( p ) , 1.0 ) #NEWLINE# #UNINDENT# last = pops [ ( - 1 ) ] #NEWLINE# self . assertAlmostEqual ( last [ 0 ] , 0.0 ) #NEWLINE# self . assertAlmostEqual ( last [ 1 ] , 0.0 ) #NEWLINE# self . assertAlmostEqual ( last [ 2 ] , 0.0 ) #NEWLINE# self . assertAlmostEqual ( last [ 3 ] , 1.0 )