def test_app_insights_get_instrumentation_key(self, mock_handler_run): self.assertEqual( AppInsightsHelper.get_instrumentation_key('azure://' + GUID), GUID) self.assertEqual( AppInsightsHelper.get_instrumentation_key( 'azure://resourceGroup/name'), GUID) mock_handler_run.assert_called_once_with('resourceGroup', 'name')
def get_handler(self): self.instrumentation_key = AppInsightsHelper.get_instrumentation_key(self.config['url']) self.subscription_id = local_session(self.ctx.policy.session_factory).get_subscription_id() return AppInsightsLogHandler(self.instrumentation_key, self.ctx.policy.name, self.subscription_id, self.ctx.execution_id)
def _initialize(self): if self.tc is not None: return self.instrumentation_key = AppInsightsHelper.get_instrumentation_key( self.config['url']) self.tc = TelemetryClient(self.instrumentation_key) self.subscription_id = local_session( self.ctx.policy.session_factory).get_subscription_id()
def test_app_insights_get_instrumentation_key(self, mock_handler_run): self.assertEqual(AppInsightsHelper.get_instrumentation_key('azure://' + GUID), GUID) self.assertEqual(AppInsightsHelper.get_instrumentation_key('azure://resourceGroup/name'), GUID) mock_handler_run.assert_called_once_with('resourceGroup', 'name')