Skip to content

Commit 4c00bad

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 209c1bb commit 4c00bad

File tree

1 file changed

+24
-17
lines changed

1 file changed

+24
-17
lines changed

tests/test_colormap_parse.py

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,33 @@
33
from branca.colormap import _parse_color_as_numerical_sequence
44

55

6-
@pytest.mark.parametrize("input_data, expected", [
7-
((0, 0, 0), (0.0, 0.0, 0.0, 1.0)),
8-
((255, 255, 255), (1.0, 1.0, 1.0, 1.0)),
9-
((255, 0, 0), (1.0, 0.0, 0.0, 1.0)),
10-
((0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 1.0)),
11-
((0.5, 0.5, 0.5), (0.5, 0.5, 0.5, 1.0)),
12-
((0.1, 0.2, 0.3, 0.4), (0.1, 0.2, 0.3, 0.4)),
13-
((0.0, 1.0, 0.0, 0.5), (0.0, 1.0, 0.0, 0.5)),
14-
((0, 0, 0, 255.0), (0.0, 0.0, 0.0, 1.0)),
15-
((0, 0, 255.0, 0.0), (0.0, 0.0, 1.0, 0.0)),
16-
])
6+
@pytest.mark.parametrize(
7+
"input_data, expected",
8+
[
9+
((0, 0, 0), (0.0, 0.0, 0.0, 1.0)),
10+
((255, 255, 255), (1.0, 1.0, 1.0, 1.0)),
11+
((255, 0, 0), (1.0, 0.0, 0.0, 1.0)),
12+
((0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 1.0)),
13+
((0.5, 0.5, 0.5), (0.5, 0.5, 0.5, 1.0)),
14+
((0.1, 0.2, 0.3, 0.4), (0.1, 0.2, 0.3, 0.4)),
15+
((0.0, 1.0, 0.0, 0.5), (0.0, 1.0, 0.0, 0.5)),
16+
((0, 0, 0, 255.0), (0.0, 0.0, 0.0, 1.0)),
17+
((0, 0, 255.0, 0.0), (0.0, 0.0, 1.0, 0.0)),
18+
],
19+
)
1720
def test_parse_color_as_numerical_sequence(input_data, expected):
1821
assert _parse_color_as_numerical_sequence(input_data) == expected
1922

20-
@pytest.mark.parametrize("input_data, raises", [
21-
((256, 0, 0), ValueError),
22-
((0, 0, -1), ValueError),
23-
((0, 1, 2, 3, 4), ValueError),
24-
((0.5, 0.5, 0.5, "string"), TypeError),
25-
])
23+
24+
@pytest.mark.parametrize(
25+
"input_data, raises",
26+
[
27+
((256, 0, 0), ValueError),
28+
((0, 0, -1), ValueError),
29+
((0, 1, 2, 3, 4), ValueError),
30+
((0.5, 0.5, 0.5, "string"), TypeError),
31+
],
32+
)
2633
def test_parse_color_as_numerical_sequence_invalid(input_data, raises):
2734
with pytest.raises(raises):
2835
_parse_color_as_numerical_sequence(input_data)

0 commit comments

Comments
 (0)