@@ -144,23 +144,31 @@ def test_url(value, error):
144144 'headless_export/output/test-basic.png' ,
145145 {
146146 'timeout' : 5 ,
147- 'format ' : 'png' ,
147+ 'format_ ' : 'png' ,
148148 'constructor' : 'Chart'
149149 },
150150 None ),
151151 ('headless_export/with-series-types.js' ,
152152 'headless_export/output/test-with-series-types.png' ,
153153 {
154154 'timeout' : 5 ,
155- 'format ' : 'png' ,
155+ 'format_ ' : 'png' ,
156156 'constructor' : 'Chart'
157157 },
158158 None ),
159159 ('headless_export/with-chart-type.js' ,
160160 'headless_export/output/test-with-chart-type.png' ,
161161 {
162162 'timeout' : 5 ,
163- 'format' : 'png' ,
163+ 'format_' : 'png' ,
164+ 'constructor' : 'Chart'
165+ },
166+ None ),
167+ ('headless_export/with-chart-type.js' ,
168+ 'headless_export/output/test-with-chart-type.svg' ,
169+ {
170+ 'timeout' : 5 ,
171+ 'format_' : 'svg' ,
164172 'constructor' : 'Chart'
165173 },
166174 None ),
@@ -177,7 +185,7 @@ def test_get_chart(input_files,
177185 target_file = check_input_file (input_files ,
178186 target_filename ,
179187 create_directory = create_output_directory )
180-
188+
181189 with open (input_file , 'r' ) as file_ :
182190 as_str = file_ .read ()
183191
@@ -190,6 +198,17 @@ def test_get_chart(input_files,
190198
191199 if not error :
192200 result = cls .get_chart (** kwargs )
201+
202+ format = kwargs .get ('format_' , None )
203+ print (f'TESTING FORMAT: { format } ' )
204+
193205 assert result is not None
194206 if target_filename :
195207 assert checkers .is_on_filesystem (target_file ) is True
208+ if format == 'svg' :
209+ with open (target_file , 'r' , encoding = 'utf-8' ) as file_ :
210+ file_contents = file_ .read ()
211+ contents = str (file_contents )
212+ assert contents .startswith (
213+ '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"'
214+ ) is True
0 commit comments