Skip to content

Commit

Permalink
Update Moran plot test
Browse files Browse the repository at this point in the history
  • Loading branch information
marcharper committed Aug 20, 2017
1 parent 1abb107 commit 55cd5c7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions axelrod/tests/unit/test_moran.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import unittest

from hypothesis import given, example, settings
import matplotlib
import matplotlib.pyplot as plt

import axelrod
Expand Down Expand Up @@ -341,9 +342,10 @@ def test_population_plot(self):
mp.populations_plot(ax=ax)
self.assertEqual(ax.get_xlim(), (-0.8, 16.8))
self.assertEqual(ax.get_ylim(), (0, 5.25))

# Run with a give axis
mp.populations_plot()
# Run without a given axis
ax = mp.populations_plot()
self.assertEqual(ax.get_xlim(), (-0.8, 16.8))
self.assertEqual(ax.get_ylim(), (0, 5.25))


class GraphMoranProcess(unittest.TestCase):
Expand Down Expand Up @@ -406,12 +408,12 @@ def test_asymmetry(self):
for seed, outcome in seeds:
axelrod.seed(seed)
mp = MoranProcess(players, interaction_graph=graph1,
reproduction_graph=graph2)
reproduction_graph=graph2)
mp.play()
winner = mp.winning_strategy_name
axelrod.seed(seed)
mp = MoranProcess(players, interaction_graph=graph2,
reproduction_graph=graph1)
reproduction_graph=graph1)
mp.play()
winner2 = mp.winning_strategy_name
self.assertEqual((winner == winner2), outcome)
Expand Down

0 comments on commit 55cd5c7

Please sign in to comment.