-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathtest_utils.py
More file actions
28 lines (24 loc) · 805 Bytes
/
test_utils.py
File metadata and controls
28 lines (24 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""
Tests for the utils.py file
"""
import axelrod as axl
import unittest
import utils
import tempfile
import csv
class TestUtils(unittest.TestCase):
"""
Simple tests for the utils
"""
axl.seed(0)
players = [s() for s in axl.demo_strategies]
tournament = axl.Tournament(players)
results = tournament.play()
def test_label(self):
label = utils.label("Test", self.results)
expected_label = "{} - turns: {}, repetitions: {}, strategies: {}. ".format("Test",
self.tournament.turns, self.tournament.repetitions,
len(self.tournament.players))
def test_obtain_assets(self):
"""Just test that this runs without crashing"""
self.assertEqual(utils.obtain_assets(self.results, assets_dir="/tmp"), None)