Class: Fog::Storage::AzureRM::Mock
- Inherits:
-
Object
- Object
- Fog::Storage::AzureRM::Mock
- Defined in:
- lib/fog/azurerm/storage.rb,
lib/fog/azurerm/requests/storage/list_storage_accounts.rb,
lib/fog/azurerm/requests/storage/create_storage_account.rb,
lib/fog/azurerm/requests/storage/delete_storage_account.rb,
lib/fog/azurerm/requests/storage/list_storage_account_for_rg.rb,
lib/fog/azurerm/requests/storage/check_storage_account_name_availability.rb
Overview
This class provides the mock implementation for unit tests.
Instance Method Summary collapse
- #check_storage_account_name_availability(params) ⇒ Object
- #create_storage_account(resource_group, name, params) ⇒ Object
- #delete_storage_account(resource_group, name) ⇒ Object
-
#initialize(options = {}) ⇒ Mock
constructor
A new instance of Mock.
- #list_storage_account_for_rg(resource_group) ⇒ Object
- #list_storage_accounts ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Mock
Returns a new instance of Mock.
24 25 26 27 28 29 30 31 32 |
# File 'lib/fog/azurerm/storage.rb', line 24 def initialize( = {}) begin require 'azure_mgmt_storage' rescue LoadError => e retry if require('rubygems') raise e. end puts "Tenand Id: #{[:tenant_id]}" end |
Instance Method Details
#check_storage_account_name_availability(params) ⇒ Object
28 29 |
# File 'lib/fog/azurerm/requests/storage/check_storage_account_name_availability.rb', line 28 def check_storage_account_name_availability(params) end |
#create_storage_account(resource_group, name, params) ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/fog/azurerm/requests/storage/create_storage_account.rb', line 22 def create_storage_account(resource_group, name, params) storage_acc = { name: name, location: params.location, resource_group: resource_group } storage_acc end |
#delete_storage_account(resource_group, name) ⇒ Object
22 23 |
# File 'lib/fog/azurerm/requests/storage/delete_storage_account.rb', line 22 def delete_storage_account(resource_group, name) end |
#list_storage_account_for_rg(resource_group) ⇒ Object
20 21 |
# File 'lib/fog/azurerm/requests/storage/list_storage_account_for_rg.rb', line 20 def list_storage_account_for_rg(resource_group) end |
#list_storage_accounts ⇒ Object
19 20 21 22 23 24 |
# File 'lib/fog/azurerm/requests/storage/list_storage_accounts.rb', line 19 def list_storage_accounts storage_acc = ::Azure::ARM::Storage::Models::StorageAccount.new storage_acc.name = 'fog-test-storage-account' storage_acc.location = 'West US' [storage_acc] end |