#NEWLINE# def test_gauge_when_overloaded( self ) : #NEWLINE# #INDENT# 'Tests the result of a gauge whose current value > the maximum' #NEWLINE# with patch ( 'redis_metrics.templatetags.redis_metric_tags.get_r' ) as mock_r : #NEWLINE# #INDENT# inst = mock_r . return_value #NEWLINE# inst . get_gauge . return_value = 500 #NEWLINE# size = 50 #NEWLINE# maximum = 200 #NEWLINE# result = taglib . gauge ( 'test-slug' , maximum , size ) #NEWLINE# expected_result = { #NEWLINE# #INDENT# 'slug' : 'test-slug' , #NEWLINE# 'current_value' : 500 , #NEWLINE# 'max_value' : maximum , #NEWLINE# 'size' : size , #NEWLINE# 'diff' : 0 , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertEqual ( result , self ) #NEWLINE# mock_r . assert_called_once_with ( ) #NEWLINE# inst . get_gauge . assert_called_once_with ( 'test-slug' )