@@ -191,24 +191,26 @@ def setUp(self):
191191
192192 self .addCleanup (patch .stopall )
193193
194- self .pool = pyredis .pool .ClusterPool (seeds = [('seed1' , 12345 ), ('seed2' , 12345 ), ('seed3' , 12345 )])
194+ self .pool = pyredis .pool .ClusterPool (seeds = [('seed1' , 12345 ), ('seed2' , 12345 ), ('seed3' , 12345 )],
195+ password = 'blubber' )
195196
196197 def test___init__ (self ):
197- self .map_mock .assert_called_with (seeds = [('seed1' , 12345 ), ('seed2' , 12345 ), ('seed3' , 12345 )])
198+ self .map_mock .assert_called_with (seeds = [('seed1' , 12345 ), ('seed2' , 12345 ), ('seed3' , 12345 )],
199+ password = 'blubber' )
198200 self .assertEqual (self .pool ._map , self .map_mock_inst )
199201 self .assertFalse (self .pool .slave_ok )
200202
201203 def test___init__slave_ok_true (self ):
202204 self .pool = pyredis .pool .ClusterPool (seeds = [('seed1' , 12345 ), ('seed2' , 12345 ), ('seed3' , 12345 )], slave_ok = True )
203- self .map_mock .assert_called_with (seeds = [('seed1' , 12345 ), ('seed2' , 12345 ), ('seed3' , 12345 )])
205+ self .map_mock .assert_called_with (seeds = [('seed1' , 12345 ), ('seed2' , 12345 ), ('seed3' , 12345 )], password = None )
204206 self .assertEqual (self .pool ._map , self .map_mock_inst )
205207 self .assertTrue (self .pool .slave_ok )
206208
207209 def test__connect (self ):
208210 client = self .pool ._connect ()
209211 self .client_mock .assert_called_with (
210212 conn_timeout = 2 ,
211- password = None ,
213+ password = 'blubber' ,
212214 read_timeout = 2 ,
213215 cluster_map = self .pool ._map ,
214216 encoding = None ,
@@ -313,7 +315,7 @@ def setUp(self):
313315 def test___init__default_args (self ):
314316 pool = pyredis .pool .SentinelPool (sentinels = [('host1' , 12345 )], name = 'mymaster' )
315317 pool ._sentinel .sentinels = [('host1' , 12345 )]
316- self .sentinelclient_mock .assert_called_with (sentinels = [('host1' , 12345 )])
318+ self .sentinelclient_mock .assert_called_with (sentinels = [('host1' , 12345 )], password = None )
317319 self .assertEqual (pool .name , 'mymaster' )
318320 self .assertEqual (pool .retries , 3 )
319321 self .assertFalse (pool .slave_ok )
@@ -325,10 +327,11 @@ def test___init__default_cust_args(self):
325327 sentinels = [('host1' , 12345 )],
326328 name = 'mymaster' ,
327329 slave_ok = True ,
328- retries = 5
330+ retries = 5 ,
331+ sentinel_password = 'blubber'
329332 )
330333 pool ._sentinel .sentinels = [('host1' , 12345 )]
331- self .sentinelclient_mock .assert_called_with (sentinels = [('host1' , 12345 )])
334+ self .sentinelclient_mock .assert_called_with (sentinels = [('host1' , 12345 )], password = 'blubber' )
332335 self .assertEqual (pool .name , 'mymaster' )
333336 self .assertEqual (pool .retries , 5 )
334337 self .assertTrue (pool .slave_ok )
0 commit comments