Fix tests.
authorSimon Cross <hodgestar@gmail.com>
Sat, 17 May 2014 19:09:21 +0000 (21:09 +0200)
committerSimon Cross <hodgestar@gmail.com>
Sat, 17 May 2014 19:09:29 +0000 (21:09 +0200)
naja/tests/test_gameboard.py
naja/tests/test_utils.py

index 4675968fd50e375c1f58a1be072399429213acae..cccd9aae88be92758b1ab658292423fdf2a532b9 100644 (file)
@@ -357,14 +357,3 @@ class TestLocationCard(TestCase):
         self.assertEqual(type(action), actions.DoNothing)
         self.assertEqual(action.required_bits, set())
         self.assertEqual(location.replacement_time, None)
-
-    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]))
index 79feefe421a049447a8dd3c495e07deaf33ffdca..4efc794fce718a6e3b7490b334c1f66108e53bd5 100644 (file)
@@ -2,7 +2,8 @@ from unittest import TestCase
 
 import pygame
 
-from naja.utils import convert_colour
+from naja.utils import convert_colour, parse_bits
+from naja.constants import BITS
 
 
 class TestConvertColour(TestCase):
@@ -17,3 +18,12 @@ class TestConvertColour(TestCase):
 
     def test_string(self):
         self.assertEqual(self.red, convert_colour('red'))
+
+
+class TestParseBits(TestCase):
+    def test_parse_bits(self):
+        self.assertEqual(parse_bits([]), frozenset([]))
+        self.assertEqual(parse_bits(['RED']), frozenset([BITS.RED]))
+        self.assertEqual(parse_bits([BITS.BLUE]), frozenset([BITS.BLUE]))
+        self.assertEqual(
+            parse_bits([BITS.NORTH, 'MSB']), frozenset([BITS.NORTH, BITS.MSB]))