- def test_parse_bits(self):
- self.assertEqual(
- LocationCard.parse_bits([]), frozenset([]))
- self.assertEqual(
- LocationCard.parse_bits(['RED']), frozenset([BITS.RED]))
- self.assertEqual(
- LocationCard.parse_bits([BITS.BLUE]), frozenset([BITS.BLUE]))
- self.assertEqual(
- LocationCard.parse_bits([BITS.NORTH, 'MSB']),
- frozenset([BITS.NORTH, BITS.MSB]))
+ def test_new_location_one_action(self):
+ location = LocationCard.new_location({
+ 'card_name': 'card1',
+ 'actions': [
+ {'required_bits': [], 'action_class': 'DoNothing'},
+ ]}, None)
+ [action] = location.actions
+ self.assertEqual(type(action), actions.DoNothing)
+ self.assertEqual(action.required_bits, set())
+ self.assertEqual(location.replacement_time, None)