File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,6 +144,7 @@ def validate_backend(s):
144144 else :
145145 return _validate_standard_backends (s )
146146
147+
147148validate_qt4 = ValidateInStrings ('backend.qt4' , ['PyQt4' , 'PySide' ])
148149
149150
@@ -264,13 +265,14 @@ def validate_string(s):
264265 assert isinstance (s , basestring )
265266 return s .strip ("'" ).strip ()
266267
268+
267269def validate_stringlist (s ):
268270 'return a list'
269271 if isinstance (s , basestring ):
270272 return [validate_string (v ) for v in s .split (',' )]
271273 else :
272274 assert type (s ) in [list , tuple ]
273- return [str (v ) for v in s ]
275+ return [validate_string (v ) for v in s ]
274276
275277
276278validate_orientation = ValidateInStrings (
Original file line number Diff line number Diff line change @@ -25,12 +25,15 @@ def test_template():
2525 assert mpl .rcParams [k ] == v [0 ]
2626
2727def test_unicode ():
28- # unicode formatted valid strings should validate.
28+ # unicode formatted valid strings should validate successfully
2929 for k , v in mpl .rcsetup .defaultParams .iteritems ():
30- if v [0 ] != v [1 ](unicode (v [0 ])):
31- print "Expected : " , v [0 ]
32- print "Actual : " , v [1 ](unicode (v [0 ]))
33- assert v [0 ] == v [1 ](unicode (v [0 ]))
30+ if k not in deprecated :
31+ if isinstance (v [0 ], basestring ):
32+ u = v [1 ](unicode (v [0 ]))
33+ if u not in [v [0 ], v [0 ].lower ()] :
34+ print "Expected : " , v [0 ]
35+ print "Actual : " , u
36+ assert u in [v [0 ], v [0 ].lower ()]
3437
3538
3639if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments