def __init__(self, method_name):
     super(AppConfigurationClientTest, self).__init__(method_name)
     self.vcr.match_on = ["path", "method", "query"]
     if self.is_playback():
         base_url = "https://fake_app_config.azconfig-test.io"
         credential = Mock(get_token=asyncio.coroutine(
             lambda _: AccessToken("fake-token", 0)))
     else:
         base_url = os.getenv('APP_CONFIG_ENDPOINT')
         credential = DefaultAzureCredential()
     app_config_client = AzureAppConfigurationClient(base_url=base_url,
                                                     credential=credential)
     self.app_config_client = AzureAppConfigurationClientProxy(
         app_config_client)
Exemplo n.º 2
0
 def create_aad_client(self, base_url):
     cred = self.get_credential(AzureAppConfigurationClient, is_async=True)
     client = AzureAppConfigurationClient(base_url, cred)
     return AzureAppConfigurationClientProxy(client)