Allow optional specification of a locations bits.
[naja.git] / naja / tests / test_gameboard.py
index 5dae954fafaae21a532b7a7d842b408f6d210101..d40873f12e707e78ef04a34e5322564c2812ed28 100644 (file)
@@ -155,3 +155,14 @@ class TestLocationCard(TestCase):
         [action] = location.actions
         self.assertEqual(type(action), actions.DoNothing)
         self.assertEqual(action.required_bits, set())
+
+    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]))