#NEWLINE# def test_get_r( self ) : #NEWLINE# #INDENT# r_kwargs = { #NEWLINE# #INDENT# 'decode_responses' : True , #NEWLINE# 'host' : 'localhost' , #NEWLINE# 'db' : 0 , #NEWLINE# 'port' : 6379 , #NEWLINE# 'password' : None , #NEWLINE# 'connection_pool' : None , #NEWLINE# 'socket_timeout' : None , #NEWLINE# #UNINDENT# } #NEWLINE# with patch ( 'redis_metrics.models.redis.StrictRedis' ) as mock_redis : #NEWLINE# #INDENT# inst = R ( ) #NEWLINE# self . assertEqual ( inst . host , 'localhost' ) #NEWLINE# self . assertEqual ( inst . port , 6379 ) #NEWLINE# self . assertEqual ( inst . db , 0 ) #NEWLINE# self . assertEqual ( inst . password , None ) #NEWLINE# #UNINDENT# self . assertEqual ( utils . _redis_model , None ) #NEWLINE# with patch ( 'redis_metrics.models.redis.StrictRedis' ) as mock_redis : #NEWLINE# #INDENT# r = utils . get_r ( ) #NEWLINE# self . assertIsInstance ( r , R ) #NEWLINE# self . assertEqual ( r , utils . _redis_model ) #NEWLINE# mock_redis . assert_called_once_with ( ** r_kwargs )