@@ -19,11 +19,11 @@ def setup():
1919if 'topojson' in mapnik .DatasourceCache .plugin_names ():
2020
2121 def test_topojson_init ():
22- # topojson tests/data/json/escaped.geojson -o tests/data/json /escaped.topojson --properties
22+ # topojson tests/data/json/escaped.geojson -o tests/data/topojson /escaped.topojson --properties
2323 # topojson version 1.4.2
2424 ds = mapnik .Datasource (
2525 type = 'topojson' ,
26- file = '../data/json /escaped.topojson' )
26+ file = '../data/topojson /escaped.topojson' )
2727 e = ds .envelope ()
2828 assert_almost_equal (e .minx , - 81.705583 , places = 7 )
2929 assert_almost_equal (e .miny , 41.480573 , places = 6 )
@@ -33,9 +33,9 @@ def test_topojson_init():
3333 def test_topojson_properties ():
3434 ds = mapnik .Datasource (
3535 type = 'topojson' ,
36- file = '../data/json /escaped.topojson' )
36+ file = '../data/topojson /escaped.topojson' )
3737 f = ds .features_at_point (ds .envelope ().center ()).features [0 ]
38- eq_ (len (ds .fields ()), 7 )
38+ eq_ (len (ds .fields ()), 11 )
3939 desc = ds .describe ()
4040 eq_ (desc ['geometry_type' ], mapnik .DataGeometryType .Point )
4141
@@ -50,9 +50,9 @@ def test_topojson_properties():
5050
5151 ds = mapnik .Datasource (
5252 type = 'topojson' ,
53- file = '../data/json /escaped.topojson' )
53+ file = '../data/topojson /escaped.topojson' )
5454 f = ds .all_features ()[0 ]
55- eq_ (len (ds .fields ()), 7 )
55+ eq_ (len (ds .fields ()), 11 )
5656
5757 desc = ds .describe ()
5858 eq_ (desc ['geometry_type' ], mapnik .DataGeometryType .Point )
@@ -70,10 +70,10 @@ def test_geojson_from_in_memory_string():
7070 ds = mapnik .Datasource (
7171 type = 'topojson' ,
7272 inline = open (
73- '../data/json /escaped.topojson' ,
73+ '../data/topojson /escaped.topojson' ,
7474 'r' ).read ())
7575 f = ds .all_features ()[0 ]
76- eq_ (len (ds .fields ()), 7 )
76+ eq_ (len (ds .fields ()), 11 )
7777
7878 desc = ds .describe ()
7979 eq_ (desc ['geometry_type' ], mapnik .DataGeometryType .Point )
@@ -91,13 +91,15 @@ def test_geojson_from_in_memory_string():
9191 def test_that_nonexistant_query_field_throws (** kwargs ):
9292 ds = mapnik .Datasource (
9393 type = 'topojson' ,
94- file = '../data/json /escaped.topojson' )
95- eq_ (len (ds .fields ()), 7 )
94+ file = '../data/topojson /escaped.topojson' )
95+ eq_ (len (ds .fields ()), 11 )
9696 # TODO - this sorting is messed up
9797 eq_ (ds .fields (), ['name' , 'int' , 'description' ,
98- 'spaces' , 'double' , 'boolean' , 'NOM_FR' ])
98+ 'spaces' , 'double' , 'boolean' , 'NOM_FR' ,
99+ 'object' , 'array' , 'empty_array' , 'empty_object' ])
99100 eq_ (ds .field_types (), ['str' , 'int' ,
100- 'str' , 'str' , 'float' , 'bool' , 'str' ])
101+ 'str' , 'str' , 'float' , 'bool' , 'str' ,
102+ 'str' , 'str' , 'str' , 'str' ])
101103# TODO - should topojson plugin throw like others?
102104# query = mapnik.Query(ds.envelope())
103105# for fld in ds.fields():
0 commit comments