#NEWLINE# def test_metric_history( self ) : #NEWLINE# #INDENT# with patch ( 'redis_metrics.templatetags.redis_metric_tags.get_r' ) as mock_r : #NEWLINE# #INDENT# history = [ ( 'm:test:2000-01-01' , 42 ) ] #NEWLINE# inst = mock_r . return_value #NEWLINE# inst . get_metric_history . return_value = history #NEWLINE# result = taglib . metric_history ( 'test' ) #NEWLINE# expected_result = { #NEWLINE# #INDENT# 'slug' : 'test' , #NEWLINE# 'granularity' : 'daily' , #NEWLINE# 'metric_history' : history , #NEWLINE# 'since' : None , #NEWLINE# 'to' : None , #NEWLINE# 'with_data_table' : False , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertEqual ( result , expected_result ) #NEWLINE# mock_r . assert_called_once_with ( ) #NEWLINE# inst . get_metric_history . assert_called_once_with ( slugs = 'test' , granularity = 'daily' , since = None , to = None )