Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Function (w/ tests) for checking that resolution specification is valid
- Loading branch information
1 parent
373752e
commit 5a58a2f
Showing
2 changed files
with
53 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
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,39 @@ | ||
import pytest | ||
from stimuli.utils import sizes | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"shape, visual_size, ppd", | ||
( | ||
((1024, 1024), (32, 32), (32, 32)), | ||
((1024, 1024), (32, 16), (32, 64)), | ||
((512, 1024), (16, 64), (32, 16)), | ||
((500, 400), (20, 40), (25, 10)), | ||
(1024, (32, 32), (32, 32)), | ||
((1024, 1024), 32, (32, 32)), | ||
((1024, 1024), (32, 32), 32), | ||
), | ||
) | ||
def test_pass_valid_resolution(shape, visual_size, ppd): | ||
sizes.valid_resolution(shape=shape, visual_size=visual_size, ppd=ppd) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"shape, visual_size, ppd", | ||
( | ||
((1024, 1024), (32, 32), (16, 16)), | ||
((1024, 1024), (32, 16), (32, 32)), | ||
((512, 1024), (32, 32), (32, 32)), | ||
((500, 400), (20, 20), (25, 10)), | ||
(1024, (32, 16), (32, 32)), | ||
((1024, 512), 32, (32, 30)), | ||
((1024, 512), (32, 32), 32), | ||
), | ||
) | ||
def test_raises_valid_resolution(shape, visual_size, ppd): | ||
with pytest.raises(ValueError) as e_info: | ||
sizes.valid_resolution(shape=shape, visual_size=visual_size, ppd=ppd) | ||
|
||
|
||
def test_resolve(): | ||
pass |