-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTests.py
More file actions
30 lines (21 loc) · 731 Bytes
/
Tests.py
File metadata and controls
30 lines (21 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
__author__ = 'martin'
import unittest
import Experiments
import PicrossAlgorithms
import bitarray
class TestAlgorithms(unittest.TestCase):
def setUp(self):
pass
def test_IOT_2_3(self):
equal=[[0, 0, 0], [0, 0, 1], [0, 1, 1], [1, 1, 1]]
self.assertEqual(PicrossAlgorithms.ImprovedOffsetMap(2,3),equal)
def test_bitarray_2_1_2(self):
lenstor=[2, 1, 2]
posstor=[0, 3, 5]
lg=8
bita=bitarray.bitarray('11010110')
self.assertEqual(PicrossAlgorithms.CreateBitarray(lenstor,posstor,lg),bita)
def test_PA_2_1_2(self):
self.assertEqual(PicrossAlgorithms.PossibleArrangements((2,1,2),8).__len__(),4)
if __name__ =="__main__":
unittest.main()