test_azure_data_factory_1.py 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. def setup_module():
  2. connection_client_secret = Connection(
  3. conn_id=DEFAULT_CONNECTION_CLIENT_SECRET,
  4. conn_type="azure_data_factory",
  5. login="clientId",
  6. password="clientSecret",
  7. extra=json.dumps(
  8. {
  9. "extra__azure_data_factory__tenantId": "tenantId",
  10. "extra__azure_data_factory__subscriptionId": "subscriptionId",
  11. "extra__azure_data_factory__resource_group_name": DEFAULT_RESOURCE_GROUP,
  12. "extra__azure_data_factory__factory_name": DEFAULT_FACTORY,
  13. }
  14. ),
  15. )
  16. connection_default_credential = Connection(
  17. conn_id=DEFAULT_CONNECTION_DEFAULT_CREDENTIAL,
  18. conn_type="azure_data_factory",
  19. extra=json.dumps(
  20. {
  21. "extra__azure_data_factory__subscriptionId": "subscriptionId",
  22. "extra__azure_data_factory__resource_group_name": DEFAULT_RESOURCE_GROUP,
  23. "extra__azure_data_factory__factory_name": DEFAULT_FACTORY,
  24. }
  25. ),
  26. )
  27. connection_missing_subscription_id = Connection(
  28. conn_id="azure_data_factory_missing_subscription_id",
  29. conn_type="azure_data_factory",
  30. login="clientId",
  31. password="clientSecret",
  32. extra=json.dumps(
  33. {
  34. "extra__azure_data_factory__tenantId": "tenantId",
  35. "extra__azure_data_factory__resource_group_name": DEFAULT_RESOURCE_GROUP,
  36. "extra__azure_data_factory__factory_name": DEFAULT_FACTORY,
  37. }
  38. ),
  39. )
  40. connection_missing_tenant_id = Connection(
  41. conn_id="azure_data_factory_missing_tenant_id",
  42. conn_type="azure_data_factory",
  43. login="clientId",
  44. password="clientSecret",
  45. extra=json.dumps(
  46. {
  47. "extra__azure_data_factory__subscriptionId": "subscriptionId",
  48. "extra__azure_data_factory__resource_group_name": DEFAULT_RESOURCE_GROUP,
  49. "extra__azure_data_factory__factory_name": DEFAULT_FACTORY,
  50. }
  51. ),
  52. )
  53. db.merge_conn(connection_client_secret)
  54. db.merge_conn(connection_default_credential)
  55. db.merge_conn(connection_missing_subscription_id)
  56. db.merge_conn(connection_missing_tenant_id)