Beispiel #1
0
 def test_summary(self):
     expected = {'.': 32, '1': 12, '2': 12, '3': 4, 'X': 4}
     testinput = ["#1 @ 1,3: 4x4", "#2 @ 3,1: 4x4", "#3 @ 5,5: 2x2"]
     testsquare = FabricSquare(rows=8, cols=8)
     for cut in testinput:
         testsquare.addcut(cut)
     testsquare.summarise()
     result = testsquare.getsummary()
     assert expected == result
Beispiel #2
0
 def test_nooverlaps(self):
     expected = '#3'
     testinput = ["#1 @ 1,3: 4x4", "#2 @ 3,1: 4x4", "#3 @ 5,5: 2x2"]
     testsquare = FabricSquare(rows=8, cols=8)
     for cut in testinput:
         testsquare.addcut(cut)
     testsquare.summarise()
     for cut in testinput:
         if testsquare.nooverlap(cut):
             result = cut.split()[0]
     assert expected == result