Skip to content

Commit ded3721

Browse files
committed
Add tests.
1 parent 0342065 commit ded3721

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

axelrod/tests/unit/test_tournament.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,10 @@ def test_build_result_set(self):
396396
results = tournament.play(progress_bar=False)
397397
self.assertIsInstance(results, axelrod.ResultSet)
398398

399+
# Test in memory
400+
results = tournament.play(progress_bar=False, in_memory=True)
401+
self.assertIsInstance(results, axelrod.ResultSet)
402+
399403
def test_no_build_result_set(self):
400404
tournament = axelrod.Tournament(
401405
name=self.test_name,
@@ -472,6 +476,16 @@ def test_write_interactions(self):
472476
calls = tournament._write_interactions.call_args_list
473477
self.assertEqual(len(calls), 15)
474478

479+
# Test when runnning in memory
480+
tournament._write_interactions = MagicMock(
481+
name='_write_interactions')
482+
self.assertTrue(tournament.play(filename=self.filename,
483+
progress_bar=False,
484+
in_memory=True))
485+
# Get the calls made to write_interactions
486+
calls = tournament._write_interactions.call_args_list
487+
self.assertEqual(len(calls), 15)
488+
475489
def test_write_to_csv(self):
476490
tournament = axelrod.Tournament(
477491
name=self.test_name,

0 commit comments

Comments
 (0)