@@ -19,7 +19,7 @@ def test_simplest_render(setup):
1919 mapnik .render (m , im )
2020 assert not im .painted ()
2121 assert im .is_solid ()
22- s = im .tostring ()
22+ s = im .to_string ()
2323 assert s == 256 * 256 * b'\x00 \x00 \x00 \x00 '
2424
2525
@@ -28,7 +28,7 @@ def test_render_image_to_string():
2828 im .fill (mapnik .Color ('black' ))
2929 assert not im .painted ()
3030 assert im .is_solid ()
31- s = im .tostring ()
31+ s = im .to_string ()
3232 assert s == 256 * 256 * b'\x00 \x00 \x00 \xff '
3333
3434
@@ -74,7 +74,7 @@ def test_setting_alpha():
7474 im2 .apply_opacity (c1 .a / 255.0 )
7575 assert not im2 .painted ()
7676 assert im2 .is_solid ()
77- assert len (im1 .tostring ('png32' )) == len (im2 .tostring ('png32' ))
77+ assert len (im1 .to_string ('png32' )) == len (im2 .to_string ('png32' ))
7878
7979
8080def test_render_image_to_file ():
@@ -114,11 +114,11 @@ def test_render_from_serialization():
114114 try :
115115 im , im2 = get_paired_images (
116116 100 , 100 , '../data/good_maps/building_symbolizer.xml' )
117- assert im .tostring ('png32' ) == im2 .tostring ('png32' )
117+ assert im .to_string ('png32' ) == im2 .to_string ('png32' )
118118
119119 im , im2 = get_paired_images (
120120 100 , 100 , '../data/good_maps/polygon_symbolizer.xml' )
121- assert im .tostring ('png32' ) == im2 .tostring ('png32' )
121+ assert im .to_string ('png32' ) == im2 .to_string ('png32' )
122122 except RuntimeError as e :
123123 # only test datasources that we have installed
124124 if not 'Could not create datasource' in str (e ):
@@ -147,7 +147,7 @@ def test_render_points():
147147 r = mapnik .Rule ()
148148 symb = mapnik .PointSymbolizer ()
149149 symb .allow_overlap = True
150- r .symbols .append (symb )
150+ r .symbolizers .append (symb )
151151 s .rules .append (r )
152152 lyr = mapnik .Layer (
153153 'Places' ,
@@ -204,7 +204,7 @@ def test_render_with_detector():
204204 lyr .styles .append ('point' )
205205 symb = mapnik .MarkersSymbolizer ()
206206 symb .allow_overlap = False
207- r .symbols .append (symb )
207+ r .symbolizers .append (symb )
208208 s .rules .append (r )
209209 m = mapnik .Map (256 , 256 )
210210 m .append_style ('point' , s )
@@ -218,7 +218,7 @@ def test_render_with_detector():
218218 im .save (actual_file , 'png8' )
219219 actual = mapnik .Image .open (expected_file )
220220 expected = mapnik .Image .open (expected_file )
221- assert actual .tostring ('png32' ) == expected .tostring ('png32' ), 'failed comparing actual (%s) and expected (%s)' % (actual_file , expected_file )
221+ assert actual .to_string ('png32' ) == expected .to_string ('png32' ), 'failed comparing actual (%s) and expected (%s)' % (actual_file , expected_file )
222222 # now render will a collision detector that should
223223 # block out the placement of this point
224224 detector = mapnik .LabelCollisionDetector (m )
@@ -254,4 +254,4 @@ def test_render_with_scale_factor():
254254 # color png
255255 actual = mapnik .Image .open (actual_file )
256256 expected = mapnik .Image .open (expected_file )
257- assert actual .tostring ('png32' ) == expected .tostring ('png32' ), 'failed comparing actual (%s) and expected (%s)' % (actual_file , expected_file )
257+ assert actual .to_string ('png32' ) == expected .to_string ('png32' ), 'failed comparing actual (%s) and expected (%s)' % (actual_file , expected_file )
0 commit comments