File tree 1 file changed +0
-64
lines changed
tests/test_optional/test_kaleido
1 file changed +0
-64
lines changed Original file line number Diff line number Diff line change @@ -125,70 +125,6 @@ def test_bytesio():
125
125
assert bio_bytes == to_image_bytes
126
126
127
127
128
- @mock .patch ("plotly.io._kaleido.to_image" )
129
- def test_to_images_single (mock_to_image ):
130
- """Test to_images with a single figure"""
131
- pio .to_images (
132
- fig ,
133
- format = "png" ,
134
- width = 800 ,
135
- height = 600 ,
136
- scale = 2 ,
137
- validate = True ,
138
- )
139
-
140
- # Verify that to_image was called once with the correct arguments
141
- expected_calls = [
142
- mock .call (
143
- fig ,
144
- format = "png" ,
145
- width = 800 ,
146
- height = 600 ,
147
- scale = 2 ,
148
- validate = True ,
149
- )
150
- ]
151
- mock_to_image .assert_has_calls (expected_calls , any_order = False )
152
- assert mock_to_image .call_count == 1
153
-
154
-
155
- @mock .patch ("plotly.io._kaleido.to_image" )
156
- def test_to_images_multiple (mock_to_image ):
157
- """Test to_images with lists"""
158
- fig1 = {"data" : [], "layout" : {"title" : {"text" : "figure 1" }}}
159
- fig2 = {"data" : [], "layout" : {"title" : {"text" : "figure 2" }}}
160
- pio .to_images (
161
- [fig1 , fig2 ],
162
- "png" ,
163
- width = [800 , 400 ],
164
- height = 600 ,
165
- scale = [1 , 2 ],
166
- validate = True ,
167
- )
168
-
169
- # Verify that to_image was called with the correct arguments in the correct order
170
- expected_calls = [
171
- mock .call (
172
- fig1 ,
173
- "png" ,
174
- width = 800 ,
175
- height = 600 ,
176
- scale = 1 ,
177
- validate = True ,
178
- ),
179
- mock .call (
180
- fig2 ,
181
- "png" ,
182
- width = 400 ,
183
- height = 600 ,
184
- scale = 2 ,
185
- validate = True ,
186
- ),
187
- ]
188
- mock_to_image .assert_has_calls (expected_calls , any_order = False )
189
- assert mock_to_image .call_count == 2
190
-
191
-
192
128
@mock .patch ("plotly.io._kaleido.write_image" )
193
129
def test_write_images_single (mock_write_image ):
194
130
"""Test write_images with only single arguments"""
You can’t perform that action at this time.
0 commit comments