Пример #1
0
    def test2(self):
        start, end = get_block_boundary(0, 2, [100, 100])
        self.assertEqual(start, [0, 0])
        self.assertEqual(end, [50, 50])

        start, end = get_block_boundary(1, 2, [100, 100])
        self.assertEqual(start, [50, 50])
        self.assertEqual(end, [100, 100])
Пример #2
0
    def test3(self):
        start, end = get_block_boundary(0, 3, [100, 100])
        self.assertEqual(start, [0, 0])
        self.assertEqual(end, [33, 33])

        start, end = get_block_boundary(1, 3, [100, 100])
        self.assertEqual(start, [33, 33])
        self.assertEqual(end, [66, 66])

        start, end = get_block_boundary(2, 3, [100, 100])
        self.assertEqual(start, [66, 66])
        self.assertEqual(end, [100, 100])
Пример #3
0
 def test1(self):
     start, end = get_block_boundary(0, 1, [100, 100])
     self.assertEqual(start, [0, 0])
     self.assertEqual(end, [100, 100])
Пример #4
0
 def test8(self):
     try:
         start, end = get_block_boundary(1, 100, [10, 10])
         self.assertTrue(False)
     except ValueError:
         self.assertTrue(True)
Пример #5
0
 def test6(self):
     start, end = get_block_boundary(42, 100, [100, 1000])
     self.assertEqual(start, [42, 420])
     self.assertEqual(end, [43, 430])