#NEWLINE# def test_sanitize( self ) : #NEWLINE# #INDENT# valid = [ ] #NEWLINE# for ( start , end ) in [ ( 'a' , 'z' ) , ( 'A' , 'Z' ) , ( '0' , '9' ) ] : #NEWLINE# #INDENT# for i in range ( ord ( start ) , ( ord ( end ) + 1 ) ) : #NEWLINE# #INDENT# valid . append ( i ) #NEWLINE# #UNINDENT# #UNINDENT# invalid = '' . join ( ( chr ( i ) for i in range ( 256 ) if ( i not in valid ) ) ) #NEWLINE# stats = { #NEWLINE# #INDENT# ( ( ( ( invalid + 'foo' ) + invalid ) + 'bar' ) + invalid ) : 5 , #NEWLINE# #UNINDENT# } #NEWLINE# for func in [ self . record , self . set_exact ] : #NEWLINE# #INDENT# func ( ** stats ) #NEWLINE# self . assertEqual ( { #NEWLINE# #INDENT# 'test-foo_bar' : 5 , #NEWLINE# #UNINDENT# } , self . snapshot ( ) )