You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/python_tests/json_feature_properties_test.py
+4-21Lines changed: 4 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,4 @@
1
-
# encoding: utf8
2
-
3
-
fromnose.toolsimporteq_
4
-
5
1
importmapnik
6
-
7
-
from .utilitiesimportrun_all
8
-
9
2
try:
10
3
importjson
11
4
exceptImportError:
@@ -83,30 +76,20 @@
83
76
ctx=mapnik.Context()
84
77
ctx.push('name')
85
78
86
-
87
79
deftest_char_escaping():
88
80
forcharinchars:
89
81
feat=mapnik.Feature(ctx, 1)
90
82
expected=char['test']
91
83
feat["name"] =expected
92
-
eq_(feat["name"], expected)
84
+
assertfeat["name"]==expected
93
85
# confirm the python json module
94
86
# is working as we would expect
95
87
pyjson2=json.loads(char['json'])
96
-
eq_(pyjson2['properties']['name'], expected)
88
+
assertpyjson2['properties']['name']==expected
97
89
# confirm our behavior is the same as python json module
98
90
# for the original string
99
91
geojson_feat_string=feat.to_geojson()
100
-
eq_(
101
-
geojson_feat_string,
102
-
char['json'],
103
-
"Mapnik's json escaping is not to spec: actual(%s) and expected(%s) for %s"%
104
-
(geojson_feat_string,
105
-
char['json'],
106
-
char['name']))
92
+
assertgeojson_feat_string==char['json'], "Mapnik's json escaping is not to spec: actual(%s) and expected(%s) for %s"% (geojson_feat_string, char['json'], char['name'])
0 commit comments