Skip to content

Commit 8559ef2

Browse files
adds test for Node NotImplementedError
1 parent 9f4f3ff commit 8559ef2

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

axelrod/.random_.py.swp

12 KB
Binary file not shown.

axelrod/strategies/dbs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from axelrod.player import Player
33

44

5-
C, D = Actions.C, Actions.D
5+
C, D = axelrod.Actions.C, axelrod.Actions.D
66

77

88
class DBS(Player):

axelrod/tests/strategies/test_dbs.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
11
"""Tests DBS strategy."""
22

33
import axelrod
4+
import unittest
45
from .test_player import TestPlayer
56

67
C, D = axelrod.Actions.C, axelrod.Actions.D
78

89

10+
class TestNode(unittest.testCase):
11+
"""
12+
Test for the base class
13+
"""
14+
node = axelrod.dbs.Node()
15+
16+
def test_get_siblings(self):
17+
with self.assetRaises(NotImplementedError) as context:
18+
self.node.get_siblings()
19+
20+
def test_is_stochastic(self):
21+
with self.assertRaises(NotImplementedError) as context:
22+
self.node.is_stochastic()
23+
24+
925
class TestDBS(TestPlayer):
1026
name = "DBS: 0.75, 3, 4, 3, 5"
1127
player = axelrod.DBS

0 commit comments

Comments
 (0)