gitlab-fog-azure-rm 1.7.0 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/.gitlab-ci.yml +12 -0
  3. data/.rubocop_todo.yml +1 -1
  4. data/CHANGELOG.md +4 -0
  5. data/gitlab-fog-azure-rm.gemspec +3 -3
  6. data/lib/fog/azurerm/constants.rb +0 -6
  7. data/lib/fog/azurerm/custom_fog_errors.rb +0 -41
  8. data/lib/fog/azurerm/docs/storage.md +1 -1
  9. data/lib/fog/azurerm/identity_encoding_filter.rb +12 -0
  10. data/lib/fog/azurerm/models/storage/directories.rb +6 -6
  11. data/lib/fog/azurerm/models/storage/directory.rb +4 -4
  12. data/lib/fog/azurerm/models/storage/file.rb +6 -3
  13. data/lib/fog/azurerm/models/storage/files.rb +8 -8
  14. data/lib/fog/azurerm/models/storage/storage_account.rb +4 -4
  15. data/lib/fog/azurerm/models/storage/storage_accounts.rb +6 -6
  16. data/lib/fog/azurerm/requests/storage/acquire_blob_lease.rb +2 -2
  17. data/lib/fog/azurerm/requests/storage/acquire_container_lease.rb +2 -2
  18. data/lib/fog/azurerm/requests/storage/check_container_exists.rb +2 -2
  19. data/lib/fog/azurerm/requests/storage/commit_blob_blocks.rb +2 -2
  20. data/lib/fog/azurerm/requests/storage/compare_container_blobs.rb +2 -2
  21. data/lib/fog/azurerm/requests/storage/copy_blob.rb +2 -2
  22. data/lib/fog/azurerm/requests/storage/copy_blob_from_uri.rb +2 -2
  23. data/lib/fog/azurerm/requests/storage/copy_object.rb +2 -2
  24. data/lib/fog/azurerm/requests/storage/create_block_blob.rb +2 -2
  25. data/lib/fog/azurerm/requests/storage/create_container.rb +2 -2
  26. data/lib/fog/azurerm/requests/storage/create_page_blob.rb +2 -2
  27. data/lib/fog/azurerm/requests/storage/delete_blob.rb +2 -2
  28. data/lib/fog/azurerm/requests/storage/delete_blob_https_url.rb +4 -4
  29. data/lib/fog/azurerm/requests/storage/delete_container.rb +2 -2
  30. data/lib/fog/azurerm/requests/storage/delete_object.rb +2 -2
  31. data/lib/fog/azurerm/requests/storage/delete_object_url.rb +2 -2
  32. data/lib/fog/azurerm/requests/storage/get_blob.rb +2 -2
  33. data/lib/fog/azurerm/requests/storage/get_blob_http_url.rb +5 -5
  34. data/lib/fog/azurerm/requests/storage/get_blob_https_url.rb +6 -5
  35. data/lib/fog/azurerm/requests/storage/get_blob_properties.rb +2 -2
  36. data/lib/fog/azurerm/requests/storage/get_blob_url.rb +4 -4
  37. data/lib/fog/azurerm/requests/storage/get_container_acl.rb +2 -2
  38. data/lib/fog/azurerm/requests/storage/get_container_properties.rb +2 -2
  39. data/lib/fog/azurerm/requests/storage/get_container_url.rb +4 -4
  40. data/lib/fog/azurerm/requests/storage/get_object.rb +2 -2
  41. data/lib/fog/azurerm/requests/storage/get_object_url.rb +2 -2
  42. data/lib/fog/azurerm/requests/storage/list_blobs.rb +2 -2
  43. data/lib/fog/azurerm/requests/storage/list_containers.rb +2 -2
  44. data/lib/fog/azurerm/requests/storage/put_blob_block.rb +2 -2
  45. data/lib/fog/azurerm/requests/storage/put_blob_http_url.rb +39 -0
  46. data/lib/fog/azurerm/requests/storage/put_blob_https_url.rb +4 -4
  47. data/lib/fog/azurerm/requests/storage/put_blob_metadata.rb +2 -2
  48. data/lib/fog/azurerm/requests/storage/put_blob_pages.rb +2 -2
  49. data/lib/fog/azurerm/requests/storage/put_blob_properties.rb +2 -2
  50. data/lib/fog/azurerm/requests/storage/put_container_acl.rb +2 -2
  51. data/lib/fog/azurerm/requests/storage/put_container_metadata.rb +2 -2
  52. data/lib/fog/azurerm/requests/storage/put_object_url.rb +2 -2
  53. data/lib/fog/azurerm/requests/storage/release_blob_lease.rb +2 -2
  54. data/lib/fog/azurerm/requests/storage/release_container_lease.rb +2 -2
  55. data/lib/fog/azurerm/requests/storage/save_page_blob.rb +2 -2
  56. data/lib/fog/azurerm/requests/storage/wait_blob_copy_operation_to_finish.rb +2 -2
  57. data/lib/fog/azurerm/storage.rb +62 -27
  58. data/lib/fog/azurerm/utilities/general.rb +2 -58
  59. data/lib/fog/azurerm/version.rb +1 -1
  60. data/lib/fog/azurerm.rb +4 -11
  61. data/rakefile +4 -5
  62. data/test/api_stub/models/storage/directory.rb +1 -1
  63. data/test/api_stub/models/storage/file.rb +1 -1
  64. data/test/api_stub/requests/storage/directory.rb +1 -1
  65. data/test/api_stub/requests/storage/file.rb +4 -4
  66. data/test/integration/README.md +5 -7
  67. data/test/integration/blob.rb +28 -36
  68. data/test/integration/container.rb +8 -39
  69. data/test/integration/credentials/azure.yml +4 -5
  70. data/test/models/storage/test_directories.rb +5 -5
  71. data/test/models/storage/test_directory.rb +2 -2
  72. data/test/models/storage/test_file.rb +16 -4
  73. data/test/models/storage/test_files.rb +8 -8
  74. data/test/requests/storage/test_acquire_blob_lease.rb +2 -2
  75. data/test/requests/storage/test_acquire_container_lease.rb +2 -2
  76. data/test/requests/storage/test_check_container_exists.rb +1 -1
  77. data/test/requests/storage/test_commit_blob_blocks.rb +2 -2
  78. data/test/requests/storage/test_compare_container_blobs.rb +2 -2
  79. data/test/requests/storage/test_copy_blob.rb +2 -2
  80. data/test/requests/storage/test_copy_blob_from_uri.rb +2 -2
  81. data/test/requests/storage/test_create_block_blob.rb +2 -2
  82. data/test/requests/storage/test_create_container.rb +2 -2
  83. data/test/requests/storage/test_create_page_blob.rb +2 -2
  84. data/test/requests/storage/test_delete_blob.rb +2 -2
  85. data/test/requests/storage/test_delete_blob_https_url.rb +7 -10
  86. data/test/requests/storage/test_delete_container.rb +2 -2
  87. data/test/requests/storage/test_delete_object.rb +2 -2
  88. data/test/requests/storage/test_get_blob.rb +2 -2
  89. data/test/requests/storage/test_get_blob_encoding.rb +45 -0
  90. data/test/requests/storage/test_get_blob_http_url.rb +13 -9
  91. data/test/requests/storage/test_get_blob_https_url.rb +95 -13
  92. data/test/requests/storage/test_get_blob_properties.rb +2 -2
  93. data/test/requests/storage/test_get_blob_url.rb +15 -24
  94. data/test/requests/storage/test_get_container_acl.rb +2 -2
  95. data/test/requests/storage/test_get_container_properties.rb +2 -2
  96. data/test/requests/storage/test_get_container_url.rb +5 -8
  97. data/test/requests/storage/test_get_object.rb +2 -2
  98. data/test/requests/storage/test_list_blobs.rb +2 -2
  99. data/test/requests/storage/test_list_containers.rb +2 -2
  100. data/test/requests/storage/test_put_blob_block.rb +2 -2
  101. data/test/requests/storage/test_put_blob_http_url.rb +33 -0
  102. data/test/requests/storage/test_put_blob_https_url.rb +8 -11
  103. data/test/requests/storage/test_put_blob_metadata.rb +2 -2
  104. data/test/requests/storage/test_put_blob_pages.rb +2 -2
  105. data/test/requests/storage/test_put_blob_properties.rb +2 -2
  106. data/test/requests/storage/test_put_container_acl.rb +2 -2
  107. data/test/requests/storage/test_put_container_metadata.rb +2 -2
  108. data/test/requests/storage/test_release_blob_lease.rb +2 -2
  109. data/test/requests/storage/test_release_container_lease.rb +2 -2
  110. data/test/requests/storage/test_save_page_blob.rb +2 -2
  111. data/test/requests/storage/test_wait_blob_copy_operation_to_finish.rb +15 -6
  112. data/test/test_helper.rb +38 -698
  113. metadata +27 -36
  114. data/lib/fog/azurerm/credentials.rb +0 -44
  115. data/lib/fog/azurerm/models/resources/azure_resource.rb +0 -25
  116. data/lib/fog/azurerm/models/resources/azure_resources.rb +0 -40
  117. data/lib/fog/azurerm/models/resources/dependency.rb +0 -27
  118. data/lib/fog/azurerm/models/resources/deployment.rb +0 -65
  119. data/lib/fog/azurerm/models/resources/deployments.rb +0 -30
  120. data/lib/fog/azurerm/models/resources/provider.rb +0 -27
  121. data/lib/fog/azurerm/models/resources/provider_resource_type.rb +0 -22
  122. data/lib/fog/azurerm/models/resources/resource_group.rb +0 -34
  123. data/lib/fog/azurerm/models/resources/resource_groups.rb +0 -29
  124. data/test/integration/storage_account.rb +0 -135
  125. data/test/smoke_tests/compute/test_resource_group_smoke.rb +0 -37
  126. data/test/test_credentials.rb +0 -63
@@ -5,12 +5,12 @@ class TestWaitBlobCopyOperationToFinish < Minitest::Test
5
5
  # This class posesses the test cases for the requests of waiting storage blob copy operation to finish.
6
6
  def setup
7
7
  Fog.mock!
8
- @mock_service = Fog::Storage::AzureRM.new(storage_account_credentials)
8
+ @mock_service = Fog::AzureRM::Storage.new(storage_account_credentials)
9
9
  Fog.unmock!
10
10
  @mocked_response = mocked_storage_http_error
11
11
  @blob = storage_blob
12
12
 
13
- @service = Fog::Storage::AzureRM.new(storage_account_credentials)
13
+ @service = Fog::AzureRM::Storage.new(storage_account_credentials)
14
14
  @blob_client = @service.instance_variable_get(:@blob_client)
15
15
  end
16
16
 
@@ -49,7 +49,9 @@ class TestWaitBlobCopyOperationToFinish < Minitest::Test
49
49
  end
50
50
 
51
51
  @service.stub :get_blob_properties, multiple_values do
52
- assert @service.wait_blob_copy_operation_to_finish('test_container', 'test_blob', copy_id, copy_status)
52
+ @service.stub :sleep, ->(delay) {} do
53
+ assert @service.wait_blob_copy_operation_to_finish('test_container', 'test_blob', copy_id, copy_status)
54
+ end
53
55
  end
54
56
  end
55
57
 
@@ -104,10 +106,17 @@ class TestWaitBlobCopyOperationToFinish < Minitest::Test
104
106
  @blob
105
107
  end
106
108
 
109
+ stubbed_times = [
110
+ Time.now,
111
+ Time.now + 5
112
+ ]
113
+
107
114
  @service.stub :get_blob_properties, multiple_values do
108
- @service.stub :delete_blob, true do
109
- assert_raises(Timeout::Error) do
110
- @service.wait_blob_copy_operation_to_finish('test_container', 'test_blob', copy_id, copy_status, 2)
115
+ Time.stub :new, -> { stubbed_times.shift } do
116
+ @service.stub :delete_blob, true do
117
+ assert_raises(Timeout::Error) do
118
+ @service.wait_blob_copy_operation_to_finish('test_container', 'test_blob', copy_id, copy_status, 2)
119
+ end
111
120
  end
112
121
  end
113
122
  end