コード例 #1
0
 def test_calcSpacerErrorMarginBorder3(self):
     layout = Layout((40, 200), border=3)
     layout.addLayer()
     self.assertEqual(0, sum(layout._calcPaddings()))
     self.assertEqual(0, layout._showSparePixels())
     layout.addLayer()
     self.assertEqual(0, layout._showSparePixels())
     self.assertEqual(1, sum(layout._paddings))
     layout.addLayer()
     self.assertEqual(0, layout._showSparePixels())
     self.assertEqual(1, sum(layout._paddings))
コード例 #2
0
    def test_spacersWidth(self):
        layout = Layout((400, 200), border=1)
        layout.addLayer()
        layout.addLayer()
        # VERIFIED correct unit test
        self.assertEqual(0, layout._showSparePixels())
        # VERIFIED correct unit test
        self.assertEqual(2, layout._sumSpacersWidth())

        layout.addLayer()
        self.assertEqual(2, layout._sumSpacersWidth())
        self.assertEqual(0, layout._showSparePixels())