<s> import unittest <EOL> import axelrod <EOL> from numpy import mean , std <EOL> import tempfile <EOL> from hypothesis import given <EOL> from hypothesis . strategies import floats , integers <EOL> class TestResultSet ( unittest . TestCase ) : <EOL> @ classmethod <EOL> def setUpClass ( cls ) : <EOL> cls . players = ( axelrod . Alternator ( ) , axelrod . TitForTat ( ) , axelrod . Defector ( ) ) <EOL> cls . turns = <NUM_LIT:5> <EOL> cls . matches = [ <EOL> { <EOL> ( <NUM_LIT:0> , <NUM_LIT:1> ) : axelrod . Match ( ( cls . players [ <NUM_LIT:0> ] , cls . players [ <NUM_LIT:1> ] ) , <EOL> turns = cls . turns ) , <EOL> ( <NUM_LIT:0> , <NUM_LIT:2> ) : axelrod . Match ( ( cls . players [ <NUM_LIT:0> ] , cls . players [ <NUM_LIT:2> ] ) , <EOL> turns = cls . turns ) , <EOL> ( <NUM_LIT:1> , <NUM_LIT:2> ) : axelrod . Match ( ( cls . players [ <NUM_LIT:1> ] , cls . players [ <NUM_LIT:2> ] ) , <EOL> turns = cls . turns ) } for _ in range ( <NUM_LIT:3> ) <EOL> ] <EOL> for rep in cls . matches : <EOL> for match in rep . values ( ) : <EOL> match . play ( ) <EOL> cls . interactions = [ ] <EOL> for rep in cls . matches : <EOL> cls . interactions . append ( { index_pair : match . result for <EOL> index_pair , match in rep . items ( ) } ) <EOL> cls . expected_players_to_match_dicts = [ { <NUM_LIT:0> : [ rep [ ( <NUM_LIT:0> , <NUM_LIT:1> ) ] , rep [ ( <NUM_LIT:0> , <NUM_LIT:2> ) ] ] , <EOL> <NUM_LIT:1> : [ rep [ ( <NUM_LIT:0> , <NUM_LIT:1> ) ] , rep [ ( <NUM_LIT:1> , <NUM_LIT:2> ) ] ] , <EOL> <NUM_LIT:2> : [ rep [ ( <NUM_LIT:1> , <NUM_LIT:2> ) ] , rep [ ( <NUM_LIT:0> , <NUM_LIT:2> ) ] ] } <EOL> for rep in cls . matches <EOL> ] <EOL> cls . expected_match_lengths = [ <EOL> [ [ <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:5> ] , [ <NUM_LIT:5> , <NUM_LIT:0> , <NUM_LIT:5> ] , [ <NUM_LIT:5> , <NUM_LIT:5> , <NUM_LIT:0> ] ] <EOL> for _ in range ( <NUM_LIT:3> ) <EOL> ] <EOL> cls . expected_scores = [ <EOL> [ <NUM_LIT:15> , <NUM_LIT:15> , <NUM_LIT:15> ] , <EOL> [ <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ] , <EOL> [ <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ] <EOL> ] <EOL> cls . expected_wins = [ <EOL> [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] , <EOL> [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] , <EOL> [ <NUM_LIT:2> , <NUM_LIT:2> , <NUM_LIT:2> ] <EOL> ] <EOL> cls . expected_normalised_scores = [ <EOL> [ <NUM_LIT> / <NUM_LIT:2> for _ in range ( <NUM_LIT:3> ) ] , <EOL> [ ( <NUM_LIT> / <NUM_LIT:5> + <NUM_LIT> / <NUM_LIT:5> ) / <NUM_LIT:2> for _ in range ( <NUM_LIT:3> ) ] , <EOL> [ ( <NUM_LIT> / <NUM_LIT:5> + <NUM_LIT> / <NUM_LIT:5> ) / <NUM_LIT:2> for _ in range ( <NUM_LIT:3> ) ] , <EOL> ] <EOL> cls . expected_ranking = [ <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:0> ] <EOL> cls . expected_ranked_names = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> cls . expected_null_results_matrix = [ <EOL> [ [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] , [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] , [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] ] , <EOL> [ [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] , [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] , [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] ] , <EOL> [ [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] , [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] , [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] ] , <EOL> ] <EOL> cls . expected_payoffs = [ <EOL> [ [ ] , [ <NUM_LIT> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] , [ <NUM_LIT:2> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] ] , <EOL> [ [ <NUM_LIT> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] , [ ] , [ <NUM_LIT:4> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] ] , <EOL> [ [ <NUM_LIT> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] , [ <NUM_LIT:9> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] , [ ] ] <EOL> ] <EOL> norm_scores = cls . expected_normalised_scores <EOL> cls . expected_score_diffs = [ <EOL> [ [ <NUM_LIT:0.0> , <NUM_LIT:0.0> , <NUM_LIT:0.0> ] , <EOL> [ <NUM_LIT:0.0> , <NUM_LIT:0.0> , <NUM_LIT:0.0> ] , <EOL> [ - <NUM_LIT> , - <NUM_LIT> , - <NUM_LIT> ] ] , <EOL> [ [ <NUM_LIT:0.0> , <NUM_LIT:0.0> , <NUM_LIT:0.0> ] , <EOL> [ <NUM_LIT:0.0> , <NUM_LIT:0.0> , <NUM_LIT:0.0> ] , <EOL> [ - <NUM_LIT:1.0> , - <NUM_LIT:1.0> , - <NUM_LIT:1.0> ] ] , <EOL> [ [ <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ] , <EOL> [ <NUM_LIT:1.0> , <NUM_LIT:1.0> , <NUM_LIT:1.0> ] , <EOL> [ <NUM_LIT:0.0> , <NUM_LIT:0.0> , <NUM_LIT:0.0> ] ] , <EOL> ] <EOL> cls . expected_payoff_diffs_means = [ <EOL> [ <NUM_LIT:0.0> , <NUM_LIT:0.0> , - <NUM_LIT> ] , <EOL> [ <NUM_LIT:0.0> , <NUM_LIT:0.0> , - <NUM_LIT:1.0> ] , <EOL> [ <NUM_LIT> , <NUM_LIT:1.0> , <NUM_LIT:0.0> ] <EOL> ] <EOL> cls . expected_payoff_matrix = [ <EOL> [ <NUM_LIT:0> , mean ( [ <NUM_LIT> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] ) , mean ( [ <NUM_LIT:2> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] ) ] , <EOL> [ mean ( [ <NUM_LIT> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] ) , <NUM_LIT:0> , mean ( [ <NUM_LIT:4> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] ) ] , <EOL> [ mean ( [ <NUM_LIT> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] ) , mean ( [ <NUM_LIT:9> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] ) , <NUM_LIT:0> ] <EOL> ] <EOL> cls . expected_payoff_stddevs = [ <EOL> [ <NUM_LIT:0> , std ( [ <NUM_LIT> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] ) , std ( [ <NUM_LIT:2> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] ) ] , <EOL> [ std ( [ <NUM_LIT> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] ) , <NUM_LIT:0> , std ( [ <NUM_LIT:4> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] ) ] , <EOL> [ std ( [ <NUM_LIT> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] ) , std ( [ <NUM_LIT:9> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] ) , <NUM_LIT:0> ] <EOL> ] <EOL> cls . expected_cooperation = [ <EOL> [ <NUM_LIT:0> , <NUM_LIT:9> , <NUM_LIT:9> ] , <EOL> [ <NUM_LIT:9> , <NUM_LIT:0> , <NUM_LIT:3> ] , <EOL> [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] , <EOL> ] <EOL> cls . expected_normalised_cooperation = [ <EOL> [ <NUM_LIT:0> , mean ( [ <NUM_LIT:3> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] ) , mean ( [ <NUM_LIT:3> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] ) ] , <EOL> [ mean ( [ <NUM_LIT:3> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] ) , <NUM_LIT:0> , mean ( [ <NUM_LIT:1> / <NUM_LIT> for _ in range ( <NUM_LIT:3> ) ] ) ] , <EOL> [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] , <EOL> ] <EOL> cls . expected_vengeful_cooperation = [ [ <NUM_LIT:2> * element - <NUM_LIT:1> for element in row ] <EOL> for row in cls . expected_normalised_cooperation ] <EOL> cls . expected_cooperating_rating = [ <EOL> <NUM_LIT> / <NUM_LIT:30> , <EOL> <NUM_LIT> / <NUM_LIT:30> , <EOL> <NUM_LIT:0> <EOL> ] <EOL> cls . expected_good_partner_matrix = [ <EOL> [ <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:3> ] , <EOL> [ <NUM_LIT:3> , <NUM_LIT:0> , <NUM_LIT:3> ] , <EOL> [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] <EOL> ] <EOL> cls . expected_good_partner_rating = [ <EOL> <NUM_LIT:1.0> , <EOL> <NUM_LIT:1.0> , <EOL> <NUM_LIT:0> <EOL> ] <EOL> cls . expected_eigenjesus_rating = [ <EOL> <NUM_LIT> , <EOL> <NUM_LIT> , <EOL> <NUM_LIT:0.0> <EOL> ] <EOL> cls . expected_eigenmoses_rating = [ <EOL> - <NUM_LIT> , <EOL> <NUM_LIT> , <EOL> <NUM_LIT> <EOL> ] <EOL> cls . expected_csv = ( <EOL> '<STR_LIT>' ) <EOL> def test_init ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertEqual ( rs . players , self . players ) <EOL> self . assertEqual ( rs . nplayers , len ( self . players ) ) <EOL> self . assertEqual ( rs . interactions , self . interactions ) <EOL> self . assertEqual ( rs . nrepetitions , len ( self . interactions ) ) <EOL> for rep in rs . interactions : <EOL> self . assertIsInstance ( rep , dict ) <EOL> for index_pair , inter in rep . items ( ) : <EOL> self . assertIsInstance ( index_pair , tuple ) <EOL> self . assertIsInstance ( inter , list ) <EOL> self . assertEqual ( len ( inter ) , self . turns ) <EOL> def test_null_results_matrix ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertEqual ( <EOL> rs . _null_results_matrix , self . expected_null_results_matrix ) <EOL> def test_match_lengths ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertIsInstance ( rs . match_lengths , list ) <EOL> self . assertEqual ( len ( rs . match_lengths ) , rs . nrepetitions ) <EOL> self . assertEqual ( rs . match_lengths , self . expected_match_lengths ) <EOL> def test_scores ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertIsInstance ( rs . scores , list ) <EOL> self . assertEqual ( len ( rs . scores ) , rs . nplayers ) <EOL> self . assertEqual ( rs . scores , self . expected_scores ) <EOL> def test_ranking ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertIsInstance ( rs . ranking , list ) <EOL> self . assertEqual ( len ( rs . ranking ) , rs . nplayers ) <EOL> self . assertEqual ( rs . ranking , self . expected_ranking ) <EOL> def test_ranked_names ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertIsInstance ( rs . ranked_names , list ) <EOL> self . assertEqual ( len ( rs . ranked_names ) , rs . nplayers ) <EOL> self . assertEqual ( rs . ranked_names , self . expected_ranked_names ) <EOL> def test_wins ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertIsInstance ( rs . wins , list ) <EOL> self . assertEqual ( len ( rs . wins ) , rs . nplayers ) <EOL> self . assertEqual ( rs . wins , self . expected_wins ) <EOL> def test_normalised_scores ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertIsInstance ( rs . normalised_scores , list ) <EOL> self . assertEqual ( len ( rs . normalised_scores ) , rs . nplayers ) <EOL> self . assertEqual ( rs . normalised_scores , self . expected_normalised_scores ) <EOL> def test_payoffs ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertIsInstance ( rs . payoffs , list ) <EOL> self . assertEqual ( len ( rs . payoffs ) , rs . nplayers ) <EOL> self . assertEqual ( rs . payoffs , self . expected_payoffs ) <EOL> def test_payoff_matrix ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertIsInstance ( rs . payoff_matrix , list ) <EOL> self . assertEqual ( len ( rs . payoff_matrix ) , rs . nplayers ) <EOL> self . assertEqual ( rs . payoff_matrix , self . expected_payoff_matrix ) <EOL> def test_score_diffs ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertIsInstance ( rs . score_diffs , list ) <EOL> self . assertEqual ( len ( rs . score_diffs ) , rs . nplayers ) <EOL> for i , row in enumerate ( rs . score_diffs ) : <EOL> for j , col in enumerate ( row ) : <EOL> for k , score in enumerate ( col ) : <EOL> self . assertAlmostEqual ( score , <EOL> self . expected_score_diffs [ i ] [ j ] [ k ] ) <EOL> def test_payoff_diffs_means ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertIsInstance ( rs . payoff_diffs_means , list ) <EOL> self . assertEqual ( len ( rs . payoff_diffs_means ) , rs . nplayers ) <EOL> for i , row in enumerate ( rs . payoff_diffs_means ) : <EOL> for j , col in enumerate ( row ) : <EOL> self . assertAlmostEqual ( col , <EOL> self . expected_payoff_diffs_means [ i ] [ j ] ) <EOL> def test_payoff_stddevs ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertIsInstance ( rs . payoff_stddevs , list ) <EOL> self . assertEqual ( len ( rs . payoff_stddevs ) , rs . nplayers ) <EOL> self . assertEqual ( rs . payoff_stddevs , self . expected_payoff_stddevs ) <EOL> def test_cooperation ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertIsInstance ( rs . cooperation , list ) <EOL> self . assertEqual ( len ( rs . cooperation ) , rs . nplayers ) <EOL> self . assertEqual ( rs . cooperation , self . expected_cooperation ) <EOL> def test_normalised_cooperation ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertIsInstance ( rs . normalised_cooperation , list ) <EOL> self . assertEqual ( len ( rs . normalised_cooperation ) , rs . nplayers ) <EOL> self . assertEqual ( rs . normalised_cooperation , <EOL> self . expected_normalised_cooperation ) <EOL> def test_vengeful_cooperation ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertIsInstance ( rs . vengeful_cooperation , list ) <EOL> self . assertEqual ( len ( rs . vengeful_cooperation ) , rs . nplayers ) <EOL> self . assertEqual ( rs . vengeful_cooperation , <EOL> self . expected_vengeful_cooperation ) <EOL> def test_cooperating_rating ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertIsInstance ( rs . cooperating_rating , list ) <EOL> self . assertEqual ( len ( rs . cooperating_rating ) , rs . nplayers ) <EOL> self . assertEqual ( rs . cooperating_rating , <EOL> self . expected_cooperating_rating ) <EOL> def test_good_partner_matrix ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertIsInstance ( rs . good_partner_matrix , list ) <EOL> self . assertEqual ( len ( rs . good_partner_matrix ) , rs . nplayers ) <EOL> self . assertEqual ( rs . good_partner_matrix , <EOL> self . expected_good_partner_matrix ) <EOL> def test_good_partner_rating ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertIsInstance ( rs . good_partner_rating , list ) <EOL> self . assertEqual ( len ( rs . good_partner_rating ) , rs . nplayers ) <EOL> self . assertEqual ( rs . good_partner_rating , <EOL> self . expected_good_partner_rating ) <EOL> def test_eigenjesus_rating ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertIsInstance ( rs . eigenjesus_rating , list ) <EOL> self . assertEqual ( len ( rs . eigenjesus_rating ) , rs . nplayers ) <EOL> for j , rate in enumerate ( rs . eigenjesus_rating ) : <EOL> self . assertAlmostEqual ( rate , self . expected_eigenjesus_rating [ j ] ) <EOL> def test_eigenmoses_rating ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertIsInstance ( rs . eigenmoses_rating , list ) <EOL> self . assertEqual ( len ( rs . eigenmoses_rating ) , rs . nplayers ) <EOL> for j , rate in enumerate ( rs . eigenmoses_rating ) : <EOL> self . assertAlmostEqual ( rate , self . expected_eigenmoses_rating [ j ] ) <EOL> def test_csv ( self ) : <EOL> rs = axelrod . ResultSet ( self . players , self . interactions ) <EOL> self . assertEqual ( rs . csv ( ) , self . expected_csv ) <EOL> class TestResultSetFromFile ( unittest . TestCase ) : <EOL> tournament = axelrod . Tournament ( <EOL> players = [ axelrod . Cooperator ( ) , <EOL> axelrod . TitForTat ( ) , <EOL> axelrod . Defector ( ) ] , <EOL> turns = <NUM_LIT:2> , <EOL> repetitions = <NUM_LIT:2> ) <EOL> tmp_file = tempfile . NamedTemporaryFile ( mode = '<STR_LIT:w>' , delete = False ) <EOL> tournament . play ( filename = tmp_file . name ) <EOL> tmp_file . close ( ) <EOL> def test_init ( self ) : <EOL> rs = axelrod . ResultSetFromFile ( self . tmp_file . name ) <EOL> players = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> self . assertEqual ( rs . players , players ) <EOL> self . assertEqual ( rs . nplayers , len ( players ) ) <EOL> self . assertEqual ( rs . nrepetitions , <NUM_LIT:2> ) <EOL> expected_interactions = [ { ( <NUM_LIT:0> , <NUM_LIT:1> ) : [ ( '<STR_LIT:C>' , '<STR_LIT:C>' ) , ( '<STR_LIT:C>' , '<STR_LIT:C>' ) ] , ( <NUM_LIT:1> , <NUM_LIT:2> ) : [ ( '<STR_LIT:C>' , '<STR_LIT:D>' ) , ( '<STR_LIT:D>' , '<STR_LIT:D>' ) ] , ( <NUM_LIT:0> , <NUM_LIT:0> ) : [ ( '<STR_LIT:C>' , '<STR_LIT:C>' ) , ( '<STR_LIT:C>' , '<STR_LIT:C>' ) ] , ( <NUM_LIT:2> , <NUM_LIT:2> ) : [ ( '<STR_LIT:D>' , '<STR_LIT:D>' ) , ( '<STR_LIT:D>' , '<STR_LIT:D>' ) ] , ( <NUM_LIT:0> , <NUM_LIT:2> ) : [ ( '<STR_LIT:C>' , '<STR_LIT:D>' ) , ( '<STR_LIT:C>' , '<STR_LIT:D>' ) ] , ( <NUM_LIT:1> , <NUM_LIT:1> ) : [ ( '<STR_LIT:C>' , '<STR_LIT:C>' ) , ( '<STR_LIT:C>' , '<STR_LIT:C>' ) ] } , { ( <NUM_LIT:0> , <NUM_LIT:1> ) : [ ( '<STR_LIT:C>' , '<STR_LIT:C>' ) , ( '<STR_LIT:C>' , '<STR_LIT:C>' ) ] , ( <NUM_LIT:1> , <NUM_LIT:2> ) : [ ( '<STR_LIT:C>' , '<STR_LIT:D>' ) , ( '<STR_LIT:D>' , '<STR_LIT:D>' ) ] , ( <NUM_LIT:0> , <NUM_LIT:0> ) : [ ( '<STR_LIT:C>' , '<STR_LIT:C>' ) , ( '<STR_LIT:C>' , '<STR_LIT:C>' ) ] , ( <NUM_LIT:2> , <NUM_LIT:2> ) : [ ( '<STR_LIT:D>' , '<STR_LIT:D>' ) , ( '<STR_LIT:D>' , '<STR_LIT:D>' ) ] , ( <NUM_LIT:0> , <NUM_LIT:2> ) : [ ( '<STR_LIT:C>' , '<STR_LIT:D>' ) , ( '<STR_LIT:C>' , '<STR_LIT:D>' ) ] , ( <NUM_LIT:1> , <NUM_LIT:1> ) : [ ( '<STR_LIT:C>' , '<STR_LIT:C>' ) , ( '<STR_LIT:C>' , '<STR_LIT:C>' ) ] } ] <EOL> self . assertEqual ( rs . interactions , expected_interactions ) <EOL> def test_string_to_interactions ( self ) : <EOL> rs = axelrod . ResultSetFromFile ( self . tmp_file . name ) <EOL> string = '<STR_LIT>' <EOL> interactions = [ ( '<STR_LIT:C>' , '<STR_LIT:D>' ) , ( '<STR_LIT:C>' , '<STR_LIT:D>' ) , ( '<STR_LIT:D>' , '<STR_LIT:D>' ) ] <EOL> self . assertEqual ( rs . _string_to_interactions ( string ) , interactions ) </s>
