test_azure_fileshare_1.py 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. def setUp(self):
  2. db.merge_conn(
  3. Connection(
  4. conn_id='azure_fileshare_test_key',
  5. conn_type='azure_file_share',
  6. login='login',
  7. password='key',
  8. )
  9. )
  10. db.merge_conn(
  11. Connection(
  12. conn_id='azure_fileshare_extras',
  13. conn_type='azure_fileshare',
  14. login='login',
  15. extra=json.dumps(
  16. {
  17. 'extra__azure_fileshare__sas_token': 'token',
  18. 'extra__azure_fileshare__protocol': 'http',
  19. }
  20. ),
  21. )
  22. )
  23. db.merge_conn(
  24. # Neither password nor sas_token present
  25. Connection(
  26. conn_id='azure_fileshare_missing_credentials',
  27. conn_type='azure_fileshare',
  28. login='login',
  29. )
  30. )
  31. db.merge_conn(
  32. Connection(
  33. conn_id='azure_fileshare_extras_deprecated',
  34. conn_type='azure_fileshare',
  35. login='login',
  36. extra=json.dumps(
  37. {
  38. 'sas_token': 'token',
  39. }
  40. ),
  41. )
  42. )
  43. db.merge_conn(
  44. Connection(
  45. conn_id='azure_fileshare_extras_deprecated_empty_wasb_extra',
  46. conn_type='azure_fileshare',
  47. login='login',
  48. password='password',
  49. extra=json.dumps(
  50. {
  51. 'extra__azure_fileshare__shared_access_key': '',
  52. }
  53. ),
  54. )
  55. )
  56. db.merge_conn(
  57. Connection(
  58. conn_id='azure_fileshare_extras_wrong',
  59. conn_type='azure_fileshare',
  60. login='login',
  61. extra=json.dumps(
  62. {
  63. 'wrong_key': 'token',
  64. }
  65. ),
  66. )
  67. )