def test_process_options_endpoint_default(self): options = common.Options() options.connection_string = None common.process_options(options) self.assertEqual(options.endpoint, 'https://dc.services.visualstudio.com')
def test_process_options_endpoint_env_cs(self): options = common.Options() options.connection_string = None os.environ['APPLICATIONINSIGHTS_CONNECTION_STRING'] = \ 'Authorization=ikey;IngestionEndpoint=456' common.process_options(options) self.assertEqual(options.endpoint, '456')
def test_process_options_ikey_env_ikey(self): options = common.Options() options.connection_string = None options.instrumentation_key = None os.environ['APPINSIGHTS_INSTRUMENTATIONKEY'] = '101112' common.process_options(options) self.assertEqual(options.instrumentation_key, '101112')
def test_process_options_proxies_set_proxies(self): options = common.Options() options.connection_string = None options.proxies = '{"https": "https://test-proxy.com"}' common.process_options(options) self.assertEqual(options.proxies, '{"https": "https://test-proxy.com"}')
def test_process_options_ikey_env_cs(self): options = common.Options() options.connection_string = None options.instrumentation_key = None os.environ['APPLICATIONINSIGHTS_CONNECTION_STRING'] = \ 'Authorization=ikey;InstrumentationKey=789' os.environ['APPINSIGHTS_INSTRUMENTATIONKEY'] = '101112' common.process_options(options) self.assertEqual(options.instrumentation_key, '789')
def test_process_options_proxies_default(self): options = common.Options() options.proxies = "{}" common.process_options(options) self.assertEqual(options.proxies, "{}")