12
12
13
13
14
14
@pytest .mark .parametrize (
15
- ("file_name" , "channel" , "pixel_to_nm_scaling" ),
15
+ ("file_name" , "channel" , "pixel_to_nm_scaling" , "image_shape" , "image_dtype" , "image_sum" ),
16
16
[
17
- pytest .param ("sample_0.spm" , "Height" , 0.4940029296875 , id = "file type 0" ),
17
+ pytest .param (
18
+ "sample_0.spm" , "Height" , 0.4940029296875 , (1024 , 1024 ), np .float64 , 30695369.188316286 , id = "file type 0"
19
+ ),
18
20
],
19
21
)
20
- def test_load_spm (file_name : str , channel : str , pixel_to_nm_scaling : float ) -> None :
22
+ def test_load_spm (
23
+ file_name : str ,
24
+ channel : str ,
25
+ pixel_to_nm_scaling : float ,
26
+ image_shape : tuple [int , int ],
27
+ image_dtype : type ,
28
+ image_sum : float ,
29
+ ) -> None :
21
30
"""Test the normal operation of loading a .spm file."""
22
31
result_image = np .ndarray
23
32
result_pixel_to_nm_scaling = float
@@ -27,6 +36,6 @@ def test_load_spm(file_name: str, channel: str, pixel_to_nm_scaling: float) -> N
27
36
28
37
assert result_pixel_to_nm_scaling == pixel_to_nm_scaling
29
38
assert isinstance (result_image , np .ndarray )
30
- assert result_image .shape == ( 1024 , 1024 )
31
- assert result_image .dtype == np . float64
32
- assert result_image .sum () == 30695369.188316286
39
+ assert result_image .shape == image_shape
40
+ assert result_image .dtype == image_dtype
41
+ assert result_image .sum () == image_sum
0 commit comments