import unittest

import numpy as np

from chainer import testing
from chainercv.transforms import pad


class TestPadTransform(unittest.TestCase):

    def test_pad_transform(self):
        img = np.random.uniform(size=(3, 32, 32))
        bg_value = -1

        out = pad(img, (34, 34), bg_value=bg_value)

        np.testing.assert_array_equal(img, out[:, 1:33, 1:33])
        np.testing.assert_array_equal(bg_value, out[:, 0, 0])


testing.run_module(__name__, __file__)

@@ -277,17 +277,17 @@
 , (34, 3
-4
+6
 ), bg_va
@@ -351,20 +351,20 @@
  out%5B:, 
-1:33
+2:34
 , 1:33%5D)

improve pad_test to be sensitive to width height order