From 2bc3952e185343ae2ff75f3f8ed738561858f61b Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sat, 17 May 2014 21:09:21 +0200 Subject: [PATCH] Fix tests. --- naja/tests/test_gameboard.py | 11 ----------- naja/tests/test_utils.py | 12 +++++++++++- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/naja/tests/test_gameboard.py b/naja/tests/test_gameboard.py index 4675968..cccd9aa 100644 --- a/naja/tests/test_gameboard.py +++ b/naja/tests/test_gameboard.py @@ -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])) diff --git a/naja/tests/test_utils.py b/naja/tests/test_utils.py index 79feefe..4efc794 100644 --- a/naja/tests/test_utils.py +++ b/naja/tests/test_utils.py @@ -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])) -- 2.34.1