def test_textures_angles(self, small_cont: ImageContainer, angles: Sequence[float]): if not len(angles): with pytest.raises(ValueError, match=r"No angles have been selected."): small_cont.features_texture("image", feature_name="foo", angles=angles) else: features = small_cont.features_texture("image", feature_name="foo", angles=angles) haystack = features.keys() for a in angles: assert any(f"angle-{a:.2f}" in h for h in haystack), haystack
def test_textures_distances(self, small_cont: ImageContainer, distances: Sequence[int]): if not len(distances): with pytest.raises(ValueError, match=r"No distances have been selected."): small_cont.features_texture("image", feature_name="foo", distances=distances) else: features = small_cont.features_texture("image", feature_name="foo", distances=distances) haystack = features.keys() for d in distances: assert any(f"dist-{d}" in h for h in haystack), haystack
def test_textures_props(self, small_cont: ImageContainer, props: Sequence[str]): if not len(props): with pytest.raises(ValueError, match=r"No properties have been selected."): small_cont.features_texture("image", feature_name="foo", props=props) else: features = small_cont.features_texture("image", feature_name="foo", props=props) haystack = features.keys() for prop in props: assert any(f"{prop}_dist" in h for h in haystack), haystack