File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,7 @@ def validate_tag_sets(dummy, value):
170170 'connecttimeoutms' : validate_timeout_or_none ,
171171 'sockettimeoutms' : validate_timeout_or_none ,
172172 'ssl' : validate_boolean ,
173+ 'readpreference' : validate_read_preference ,
173174 'read_preference' : validate_read_preference ,
174175 'tag_sets' : validate_tag_sets ,
175176 'secondaryacceptablelatencyms' : validate_positive_float ,
@@ -266,7 +267,7 @@ def __set_options(self, options):
266267 for option , value in options .iteritems ():
267268 if option in ('slave_okay' , 'slaveok' ):
268269 self .__slave_okay = validate_boolean (option , value )
269- elif option == 'read_preference' :
270+ elif option in ( 'read_preference' , "readpreference" ) :
270271 self .__read_pref = validate_read_preference (option , value )
271272 elif option == 'tag_sets' :
272273 self .__tag_sets = validate_tag_sets (option , value )
Original file line number Diff line number Diff line change @@ -270,9 +270,9 @@ def test_parse_uri(self):
270270 "test.yield_historical.in?slaveok=true" ))
271271
272272 res = copy .deepcopy (orig )
273- res ['options' ] = {'read_preference ' : ReadPreference .SECONDARY }
273+ res ['options' ] = {'readpreference ' : ReadPreference .SECONDARY }
274274 self .assertEqual (res ,
275- parse_uri ("mongodb://localhost/?read_preference =secondary" ))
275+ parse_uri ("mongodb://localhost/?readPreference =secondary" ))
276276
277277if __name__ == "__main__" :
278278 unittest .main ()
You can’t perform that action at this time.
0 commit comments