Example #1
0
    def test_parse_connection_string_location(self):
        cs = 'Authorization=ikey;EndpointSuffix=suffix;Location=us'
        result = common.parse_connection_string(cs)

        self.assertEqual(result['ingestionendpoint'], 'https://us.dc.suffix')
Example #2
0
    def test_parse_connection_string_default(self):
        cs = 'Authorization=ikey;Location=us'
        result = common.parse_connection_string(cs)

        self.assertEqual(result['ingestionendpoint'],
                         None)
Example #3
0
    def test_parse_connection_string_explicit_endpoint(self):
        cs = 'Authorization=ikey;IngestionEndpoint=123;' \
            'Location=us;EndpointSuffix=suffix'
        result = common.parse_connection_string(cs)

        self.assertEqual(result['ingestionendpoint'], '123')
Example #4
0
 def test_parse_connection_string_invalid_auth(self):
     cs = 'Authorization=asd'
     self.assertRaises(ValueError,
                       lambda: common.parse_connection_string(cs))
Example #5
0
 def test_parse_connection_string_default_auth(self):
     cs = 'InstrumentationKey=123'
     result = common.parse_connection_string(cs)
     self.assertEqual(result['instrumentationkey'], '123')
Example #6
0
    def test_parse_connection_string_none(self):
        cs = None
        result = common.parse_connection_string(cs)

        self.assertEqual(result, {})