1 from unittest import TestCase
3 from naja.constants import BITS
4 from naja.gameboard import LocationCard
7 class TestLocationCard(TestCase):
8 def test_generate_bitwise_operand(self):
9 # This is testing a random process, so it may fail occasionally.
12 operand_sets.append(LocationCard.generate_bitwise_operand())
15 for operand_set in operand_sets:
16 sizes[len(operand_set)] += 1
17 bits.update(operand_set)
18 # TODO: Test that there's at least one condition and one direction.
19 self.assertTrue(sizes[2] > 0)
20 self.assertTrue(sizes[3] > 0)
21 self.assertTrue(sizes[2] > sizes[3])
22 self.assertEqual(bits, set(BITS.values()))