|
1 | 1 | import unittest
|
2 | 2 | from axelrod import Actions, flip_action
|
3 |
| -from axelrod.actions import str_to_actions, UnknownAction, actions_to_str |
| 3 | +from axelrod.actions import str_to_actions, UnknownActionError, actions_to_str |
4 | 4 |
|
5 | 5 | C, D = Actions.C, Actions.D
|
6 | 6 |
|
@@ -34,25 +34,25 @@ def test_from_char(self):
|
34 | 34 | self.assertEqual(Actions.from_char('D'), D)
|
35 | 35 |
|
36 | 36 | def test_from_char_error(self):
|
37 |
| - self.assertRaises(UnknownAction, Actions.from_char, '') |
38 |
| - self.assertRaises(UnknownAction, Actions.from_char, 'c') |
39 |
| - self.assertRaises(UnknownAction, Actions.from_char, 'd') |
40 |
| - self.assertRaises(UnknownAction, Actions.from_char, 'A') |
| 37 | + self.assertRaises(UnknownActionError, Actions.from_char, '') |
| 38 | + self.assertRaises(UnknownActionError, Actions.from_char, 'c') |
| 39 | + self.assertRaises(UnknownActionError, Actions.from_char, 'd') |
| 40 | + self.assertRaises(UnknownActionError, Actions.from_char, 'A') |
41 | 41 |
|
42 | 42 | def test_flip_action(self):
|
43 | 43 | self.assertEqual(flip_action(D), C)
|
44 | 44 | self.assertEqual(flip_action(C), D)
|
45 | 45 |
|
46 | 46 | def test_flip_action_error(self):
|
47 |
| - self.assertRaises(UnknownAction, flip_action, 'R') |
| 47 | + self.assertRaises(UnknownActionError, flip_action, 'R') |
48 | 48 |
|
49 | 49 | def test_str_to_actions(self):
|
50 | 50 | self.assertEqual(str_to_actions(''), ())
|
51 | 51 | self.assertEqual(str_to_actions('C'), (C, ))
|
52 | 52 | self.assertEqual(str_to_actions('CDDC'), (C, D, D, C))
|
53 | 53 |
|
54 | 54 | def test_str_to_actions_fails_fast_and_raises_value_error(self):
|
55 |
| - self.assertRaises(UnknownAction, str_to_actions, 'Cc') |
| 55 | + self.assertRaises(UnknownActionError, str_to_actions, 'Cc') |
56 | 56 |
|
57 | 57 | def test_actions_to_str(self):
|
58 | 58 | self.assertEqual(actions_to_str([]), "")
|
|
0 commit comments