X-Git-Url: https://git.ctpug.org.za/?p=naja.git;a=blobdiff_plain;f=naja%2Ftests%2Ftest_utils.py;h=4efc794fce718a6e3b7490b334c1f66108e53bd5;hp=79feefe421a049447a8dd3c495e07deaf33ffdca;hb=2bc3952e185343ae2ff75f3f8ed738561858f61b;hpb=0e194e3fdf803dca638aff1d0c40b2d70cfe4b4e 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]))