def test_aad_user_token(self):
     """Checks kcsb that is created with AAD user token."""
     token = "The user hardest token ever"
     kcsb = KustoConnectionStringBuilder.with_aad_user_token_authentication("localhost", user_token=token)
     assert kcsb.data_source == "localhost"
     assert kcsb.user_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.application_token is None
     assert kcsb.authority_id == "common"
     assert repr(kcsb) == "Data Source=localhost;AAD Federated Security=True;Authority Id=common;User Token=%s" % token
     assert str(kcsb) == "Data Source=localhost;AAD Federated Security=True;Authority Id=common;User Token=%s" % self.PASSWORDS_REPLACEMENT
 def test_aad_user_token(self):
     """Checks kcsb that is created with AAD user token."""
     token = "The user hardest token ever"
     kcsb = KustoConnectionStringBuilder.with_aad_user_token_authentication(
         "localhost", user_token=token)
     self.assertEqual(kcsb.data_source, "localhost")
     self.assertEqual(kcsb.user_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.application_token)
     self.assertEqual(kcsb.authority_id, "common")
     self.assertEqual(
         repr(kcsb),
         "Data Source=localhost;AAD Federated Security=True;Authority Id=common;User Token=%s"
         % token)
     self.assertEqual(
         str(kcsb),
         "Data Source=localhost;AAD Federated Security=True;Authority Id=common;User Token=%s"
         % self.PASSWORDS_REPLACEMENT,
     )