#NEWLINE# def test_metric_logging_with_bad_name( self ) : #NEWLINE# #INDENT# monitor_instance = ScalyrLoggingTest . FakeMonitor ( 'testing' ) #NEWLINE# metric_file_path = tempfile . mktemp ( '.log' ) #NEWLINE# monitor_logger = scalyr_logging . getLogger ( 'scalyr_agent.builtin_monitors.foo(1)' ) #NEWLINE# monitor_logger . openMetricLogForMonitor ( metric_file_path , monitor_instance ) #NEWLINE# monitor_logger . emit_value ( '1name' , 5 ) #NEWLINE# self . assertTrue ( self . __log_contains ( 'sa_1name' , file_path = metric_file_path ) ) #NEWLINE# monitor_logger . emit_value ( 'name+hi' , 5 ) #NEWLINE# self . assertTrue ( self . __log_contains ( 'name_hi' , file_path = metric_file_path ) ) #NEWLINE# monitor_logger . emit_value ( 'name' , 5 , { #NEWLINE# #INDENT# 'hi+' : 6 , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertTrue ( self . __log_contains ( 'hi_' , file_path = metric_file_path ) ) #NEWLINE# monitor_logger . closeMetricLog ( )