X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=naja%2Ftests%2Ftest_gameboard.py;h=5b383991273e9d20f919a54cfec4104913ffcbae;hb=cccf26b59edcba80bcc68b58f0d1faa487576213;hp=2db02a78b436d8bdf72dabb9c5f888e0fd547285;hpb=c898dde791f095d5e2c5f0e4ad82785547935383;p=naja.git diff --git a/naja/tests/test_gameboard.py b/naja/tests/test_gameboard.py index 2db02a7..5b38399 100644 --- a/naja/tests/test_gameboard.py +++ b/naja/tests/test_gameboard.py @@ -12,7 +12,7 @@ class TestGameBoard(TestCase): def make_deck(self, cards=None): if cards is None: - cards = [{'actions': []}] + cards = [{'card_name': 'card', 'actions': []}] return {'cards': cards} def assert_state(self, state1, state2, exclude=(), player_exclude=()): @@ -30,7 +30,8 @@ class TestGameBoard(TestCase): self.assertEqual(state1, state2) def test_export_new_board(self): - board = GameBoard.new_game({'cards': [{'actions': [ + board = GameBoard.new_game({'cards': [ + {'card_name' : 'card1', 'actions': [ { 'action_class': 'LoseHealthOrMSB', 'required_bits': [], @@ -46,7 +47,7 @@ class TestGameBoard(TestCase): 'health': 4, 'wins_required': 4, 'wins': 0, - 'locations': [{'actions': [ + 'locations': [{'card_name' : 'card1', 'actions': [ { 'action_class': 'LoseHealthOrMSB', 'required_bits': [], @@ -63,7 +64,8 @@ class TestGameBoard(TestCase): for position, location_state in board_locations: positions.append(position) self.assertEqual( - sorted(location_state.keys()), ['actions', 'bitwise_operand']) + sorted(location_state.keys()), ['actions', 'bitwise_operand', + 'card_name']) self.assertEqual(location_state['actions'], [ { 'action_class': 'LoseHealthOrMSB', @@ -244,14 +246,15 @@ class TestLocationCard(TestCase): self.assertEqual(bits, set(BITS.values())) def test_new_location_no_actions(self): - location = LocationCard.new_location({'actions': []}) + location = LocationCard.new_location({'card_name': 'card', + 'actions': []}) [action] = location.actions self.assertEqual(type(action), actions.DoNothing) self.assertEqual(action.required_bits, set()) def test_new_location_one_action(self): - location = LocationCard.new_location({'actions': [ - {'required_bits': [], 'action_class': 'DoNothing'}, + location = LocationCard.new_location({'card_name': 'card1', + 'actions': [{'required_bits': [], 'action_class': 'DoNothing'}, ]}) [action] = location.actions self.assertEqual(type(action), actions.DoNothing)