Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65f60fe
commit a348153
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import numpy as np | ||
import pytest | ||
|
||
from stimuli.utils import pad | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"img_shape, padding, result", | ||
[ | ||
((128, 128), (64, 64), (256, 256)), | ||
((100, 100), (64, 64), (228, 228)), | ||
((128, 128), ((64, 64), (64, 64)), (256, 256)), | ||
((128, 128), ((64, 64), (128, 128)), (256, 384)), | ||
((128, 100), ((64, 64), (100, 128)), (256, 328)), | ||
((128, 100), 64, (256, 228)), | ||
], | ||
) | ||
def test_pad_by_shape(img_shape, padding, result): | ||
img = np.ones(img_shape) | ||
padded = pad.pad_by_shape(img, padding) | ||
assert padded.shape == result |