def test_aad_app_token(self): """Checks kcsb that is created with AAD user token.""" token = "The app hardest token ever" kcsb = KustoConnectionStringBuilder.with_aad_application_token_authentication("localhost", application_token=token) assert kcsb.data_source == "localhost" assert kcsb.application_token == token assert kcsb.aad_federated_security assert kcsb.aad_user_id is None assert kcsb.password is None assert kcsb.application_client_id is None assert kcsb.application_key is None assert kcsb.user_token is None assert kcsb.authority_id == "common" assert repr(kcsb) == "Data Source=localhost;AAD Federated Security=True;Authority Id=common;Application Token=%s" % token assert str(kcsb) == "Data Source=localhost;AAD Federated Security=True;Authority Id=common;Application Token=%s" % self.PASSWORDS_REPLACEMENT
def test_aad_app_token(self): """Checks kcsb that is created with AAD user token.""" token = "The app hardest token ever" kcsb = KustoConnectionStringBuilder.with_aad_application_token_authentication( "localhost", application_token=token) self.assertEqual(kcsb.data_source, "localhost") self.assertEqual(kcsb.application_token, token) self.assertTrue(kcsb.aad_federated_security) self.assertIsNone(kcsb.aad_user_id) self.assertIsNone(kcsb.password) self.assertIsNone(kcsb.application_client_id) self.assertIsNone(kcsb.application_key) self.assertIsNone(kcsb.user_token) self.assertEqual(kcsb.authority_id, "common") self.assertEqual( repr(kcsb), "Data Source=localhost;AAD Federated Security=True;Authority Id=common;Application Token=%s" % token, ) self.assertEqual( str(kcsb), "Data Source=localhost;AAD Federated Security=True;Authority Id=common;Application Token=%s" % self.PASSWORDS_REPLACEMENT, )