def testPartII(self):
        images = createImages(parse('0222112222120000'), 4, 2, 2)
        np.testing.assert_array_equal(images,
                                      [[[0, 2], [2, 2]], [[1, 1], [2, 2]],
                                       [[2, 2], [1, 2]], [[0, 0], [0, 0]]])

        image = combine(images)

        self.assertEqual(image, [0, 1, 1, 0])
 def testPartI(self):
     images = createImages(parse('123456789012'), 2, 2, 3)
     #self.assertEqual(images, [[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [0, 1, 2]]])
     np.testing.assert_array_equal(
         images, [[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [0, 1, 2]]])
Ejemplo n.º 3
0
 def testParse(self):
     self.assertEqual(parse('1,9,10,3,2,3,11,0,99,30,40,50'),
                      [1, 9, 10, 3, 2, 3, 11, 0, 99, 30, 40, 50])
 def testParse(self):
     data = '123456789012'
     self.assertEqual(parse(data), [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2])
Ejemplo n.º 5
0
 def testProcess(self):
     data = parse('1,9,10,3,2,3,11,0,99,30,40,50')
     self.assertEqual(process(data), (3500, 9, 10))