@@ -68,7 +68,7 @@ def check_file_is_empty():
6868
6969
7070def set_up (
71- isdiagnostics_enabled ,
71+ is_diagnostics_enabled ,
7272 logger = TEST_LOGGER ,
7373 subscription_id_env_var = TEST_SUBSCRIPTION_ID_ENV_VAR ,
7474) -> None :
@@ -109,80 +109,80 @@ def set_up(
109109 ).start ()
110110 patch (
111111 "azure.monitor.opentelemetry.diagnostics._diagnostic_logging._IS_DIAGNOSTICS_ENABLED" ,
112- isdiagnostics_enabled ,
112+ is_diagnostics_enabled ,
113113 ).start ()
114114 diagnostic_logger .AzureDiagnosticLogging .enable (logger )
115115
116116
117117class TestDiagnosticLogger (TestCase ):
118118 def test_initialized (self ):
119- set_up (isdiagnostics_enabled = True )
119+ set_up (is_diagnostics_enabled = True )
120120 self .assertTrue (diagnostic_logger .AzureDiagnosticLogging ._initialized )
121121
122122 def test_uninitialized (self ):
123- set_up (isdiagnostics_enabled = False )
123+ set_up (is_diagnostics_enabled = False )
124124 self .assertFalse (diagnostic_logger .AzureDiagnosticLogging ._initialized )
125125
126126 def test_info (self ):
127- set_up (isdiagnostics_enabled = True )
127+ set_up (is_diagnostics_enabled = True )
128128 TEST_LOGGER_SUB_MODULE .info (MESSAGE1 )
129129 TEST_LOGGER_SUB_MODULE .info (MESSAGE2 )
130130 check_file_is_empty ()
131131
132132 def test_info_with_info_log_level (self ):
133- set_up (isdiagnostics_enabled = True )
133+ set_up (is_diagnostics_enabled = True )
134134 TEST_LOGGER_SUB_MODULE .setLevel (logging .INFO )
135135 TEST_LOGGER_SUB_MODULE .info (MESSAGE1 )
136136 TEST_LOGGER_SUB_MODULE .info (MESSAGE2 )
137137 TEST_LOGGER_SUB_MODULE .setLevel (logging .NOTSET )
138138 check_file_for_messages ("INFO" , (MESSAGE1 , MESSAGE2 ))
139139
140140 def test_info_with_sub_module_info_log_level (self ):
141- set_up (isdiagnostics_enabled = True )
141+ set_up (is_diagnostics_enabled = True )
142142 TEST_LOGGER_SUB_MODULE .setLevel (logging .INFO )
143143 TEST_LOGGER_SUB_MODULE .info (MESSAGE1 )
144144 TEST_LOGGER_SUB_MODULE .info (MESSAGE2 )
145145 TEST_LOGGER_SUB_MODULE .setLevel (logging .NOTSET )
146146 check_file_for_messages ("INFO" , (MESSAGE1 , MESSAGE2 ))
147147
148148 def test_warning (self ):
149- set_up (isdiagnostics_enabled = True )
149+ set_up (is_diagnostics_enabled = True )
150150 TEST_LOGGER_SUB_MODULE .warning (MESSAGE1 )
151151 TEST_LOGGER_SUB_MODULE .warning (MESSAGE2 )
152152 check_file_for_messages ("WARNING" , (MESSAGE1 , MESSAGE2 ))
153153
154154 def test_warning_multiple_enable (self ):
155- set_up (isdiagnostics_enabled = True )
155+ set_up (is_diagnostics_enabled = True )
156156 diagnostic_logger .AzureDiagnosticLogging .enable (TEST_LOGGER )
157157 diagnostic_logger .AzureDiagnosticLogging .enable (TEST_LOGGER )
158158 TEST_LOGGER_SUB_MODULE .warning (MESSAGE1 )
159159 TEST_LOGGER_SUB_MODULE .warning (MESSAGE2 )
160160 check_file_for_messages ("WARNING" , (MESSAGE1 , MESSAGE2 ))
161161
162162 def test_error (self ):
163- set_up (isdiagnostics_enabled = True )
163+ set_up (is_diagnostics_enabled = True )
164164 TEST_LOGGER_SUB_MODULE .error (MESSAGE1 )
165165 TEST_LOGGER_SUB_MODULE .error (MESSAGE2 )
166166 check_file_for_messages ("ERROR" , (MESSAGE1 , MESSAGE2 ))
167167
168168 def test_off_app_service_info (self ):
169- set_up (isdiagnostics_enabled = False )
169+ set_up (is_diagnostics_enabled = False )
170170 TEST_LOGGER .info (MESSAGE1 )
171171 TEST_LOGGER .info (MESSAGE2 )
172172 TEST_LOGGER_SUB_MODULE .info (MESSAGE1 )
173173 TEST_LOGGER_SUB_MODULE .info (MESSAGE2 )
174174 check_file_is_empty ()
175175
176176 def test_off_app_service_warning (self ):
177- set_up (isdiagnostics_enabled = False )
177+ set_up (is_diagnostics_enabled = False )
178178 TEST_LOGGER .warning (MESSAGE1 )
179179 TEST_LOGGER .warning (MESSAGE2 )
180180 TEST_LOGGER_SUB_MODULE .warning (MESSAGE1 )
181181 TEST_LOGGER_SUB_MODULE .warning (MESSAGE2 )
182182 check_file_is_empty ()
183183
184184 def test_off_app_service_error (self ):
185- set_up (isdiagnostics_enabled = False )
185+ set_up (is_diagnostics_enabled = False )
186186 TEST_LOGGER .error (MESSAGE1 )
187187 TEST_LOGGER .error (MESSAGE2 )
188188 TEST_LOGGER_SUB_MODULE .error (MESSAGE1 )
@@ -191,7 +191,7 @@ def test_off_app_service_error(self):
191191
192192 def test_subscription_id_plus (self ):
193193 set_up (
194- isdiagnostics_enabled = True ,
194+ is_diagnostics_enabled = True ,
195195 subscription_id_env_var = TEST_SUBSCRIPTION_ID_ENV_VAR ,
196196 )
197197 self .assertEqual (
@@ -203,7 +203,7 @@ def test_subscription_id_plus(self):
203203
204204 def test_subscription_id_no_plus (self ):
205205 set_up (
206- isdiagnostics_enabled = True ,
206+ is_diagnostics_enabled = True ,
207207 subscription_id_env_var = TEST_SUBSCRIPTION_ID ,
208208 )
209209 self .assertEqual (
0 commit comments