@@ -33,9 +33,15 @@ def test_handle_flate__image_mode_1():
33
33
data = b"\x00 \xe0 \x00 "
34
34
lookup = DecodedStreamObject ()
35
35
expected_data = [
36
- (66 , 66 , 66 ), (66 , 66 , 66 ), (66 , 66 , 66 ),
37
- (0 , 19 , 55 ), (0 , 19 , 55 ), (0 , 19 , 55 ),
38
- (66 , 66 , 66 ), (66 , 66 , 66 ), (66 , 66 , 66 )
36
+ (66 , 66 , 66 ),
37
+ (66 , 66 , 66 ),
38
+ (66 , 66 , 66 ),
39
+ (0 , 19 , 55 ),
40
+ (0 , 19 , 55 ),
41
+ (0 , 19 , 55 ),
42
+ (66 , 66 , 66 ),
43
+ (66 , 66 , 66 ),
44
+ (66 , 66 , 66 ),
39
45
]
40
46
41
47
# No trailing data.
@@ -44,9 +50,11 @@ def test_handle_flate__image_mode_1():
44
50
size = (3 , 3 ),
45
51
data = data ,
46
52
mode = "1" ,
47
- color_space = ArrayObject ([NameObject ("/Indexed" ), NameObject ("/DeviceRGB" ), NumberObject (1 ), lookup ]),
53
+ color_space = ArrayObject (
54
+ [NameObject ("/Indexed" ), NameObject ("/DeviceRGB" ), NumberObject (1 ), lookup ]
55
+ ),
48
56
colors = 2 ,
49
- obj_as_text = "dummy"
57
+ obj_as_text = "dummy" ,
50
58
)
51
59
assert expected_data == list (result [0 ].getdata ())
52
60
@@ -56,32 +64,52 @@ def test_handle_flate__image_mode_1():
56
64
size = (3 , 3 ),
57
65
data = data ,
58
66
mode = "1" ,
59
- color_space = ArrayObject ([NameObject ("/Indexed" ), NameObject ("/DeviceRGB" ), NumberObject (1 ), lookup ]),
67
+ color_space = ArrayObject (
68
+ [NameObject ("/Indexed" ), NameObject ("/DeviceRGB" ), NumberObject (1 ), lookup ]
69
+ ),
60
70
colors = 2 ,
61
- obj_as_text = "dummy"
71
+ obj_as_text = "dummy" ,
62
72
)
63
73
assert expected_data == list (result [0 ].getdata ())
64
74
65
75
# Trailing non-whitespace character.
66
76
lookup .set_data (b"\x42 \x42 \x42 \x00 \x13 \x37 \x12 " )
67
- with pytest .raises (PdfReadError , match = r"^Too many lookup values: Expected 6, got 7\.$" ):
77
+ with pytest .raises (
78
+ PdfReadError , match = r"^Too many lookup values: Expected 6, got 7\.$"
79
+ ):
68
80
_handle_flate (
69
81
size = (3 , 3 ),
70
82
data = data ,
71
83
mode = "1" ,
72
- color_space = ArrayObject ([NameObject ("/Indexed" ), NameObject ("/DeviceRGB" ), NumberObject (1 ), lookup ]),
84
+ color_space = ArrayObject (
85
+ [
86
+ NameObject ("/Indexed" ),
87
+ NameObject ("/DeviceRGB" ),
88
+ NumberObject (1 ),
89
+ lookup ,
90
+ ]
91
+ ),
73
92
colors = 2 ,
74
- obj_as_text = "dummy"
93
+ obj_as_text = "dummy" ,
75
94
)
76
95
77
96
# Not enough lookup data.
78
97
lookup .set_data (b"\x42 \x42 \x42 \x00 \x13 " )
79
- with pytest .raises (PdfReadError , match = r"^Not enough lookup values: Expected 6, got 5\.$" ):
98
+ with pytest .raises (
99
+ PdfReadError , match = r"^Not enough lookup values: Expected 6, got 5\.$"
100
+ ):
80
101
_handle_flate (
81
102
size = (3 , 3 ),
82
103
data = data ,
83
104
mode = "1" ,
84
- color_space = ArrayObject ([NameObject ("/Indexed" ), NameObject ("/DeviceRGB" ), NumberObject (1 ), lookup ]),
105
+ color_space = ArrayObject (
106
+ [
107
+ NameObject ("/Indexed" ),
108
+ NameObject ("/DeviceRGB" ),
109
+ NumberObject (1 ),
110
+ lookup ,
111
+ ]
112
+ ),
85
113
colors = 2 ,
86
- obj_as_text = "dummy"
114
+ obj_as_text = "dummy" ,
87
115
)
0 commit comments