def test_copy_img(): with pytest.raises(ValueError, match="Input value is not an image"): niimg.copy_img(3)
def test_copy_img_side_effect(): img1 = Nifti1Image(np.ones((2, 2, 2, 2)), affine=np.eye(4)) hash1 = joblib.hash(img1) niimg.copy_img(img1) hash2 = joblib.hash(img1) assert_equal(hash1, hash2)