示例#1
0
    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')
示例#2
0
    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')
示例#3
0
    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')
示例#4
0
    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"}')
示例#5
0
    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')
示例#6
0
    def test_process_options_proxies_default(self):
        options = common.Options()
        options.proxies = "{}"
        common.process_options(options)

        self.assertEqual(options.proxies, "{}")