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=()):
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': [],
'health': 4,
'wins_required': 4,
'wins': 0,
- 'locations': [{'actions': [
+ 'locations': [{'card_name' : 'card1', 'actions': [
{
'action_class': 'LoseHealthOrMSB',
'required_bits': [],
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',
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)