Skip to content

Commit

Permalink
Merge pull request #314 from fog/fix-unit-tests
Browse files Browse the repository at this point in the history
Fixed unit tests
  • Loading branch information
bilal-naeem-confiz authored Sep 22, 2017
2 parents 8667de4 + 9a503f6 commit 72c7dd1
Show file tree
Hide file tree
Showing 41 changed files with 72 additions and 52 deletions.
5 changes: 2 additions & 3 deletions fog-azure-rm.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require 'fog/azurerm/version'
Gem::Specification.new do |spec|
spec.name = 'fog-azure-rm'
spec.version = Fog::AzureRM::VERSION
spec.authors = ['Shaffan Chaudhry', 'Samawia Moin', 'Adnan Khalil', 'Zeeshan Arshad', 'Haider Ali', 'Waqar Haider', 'Bilal Naeem', 'Muhammad Asad', 'Azeem Sajid', 'Maham Nazir']
spec.authors = ['Shaffan Chaudhry', 'Samawia Moin', 'Adnan Khalil', 'Zeeshan Arshad', 'Haider Ali', 'Waqar Haider', 'Bilal Naeem', 'Muhammad Asad', 'Azeem Sajid', 'Maham Nazir', 'Abbas Sheikh']
spec.summary = "Module for the 'fog' gem to support Azure Resource Manager cloud services."
spec.description = "This library can be used as a module for 'fog' or as standalone provider
to use the Azure Resource Manager cloud services in applications.."
Expand All @@ -24,7 +24,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'codeclimate-test-reporter' , '~> 1.0.0'
spec.add_dependency 'fog-core', '~> 1.43.0'
spec.add_dependency 'fog-json', '~> 1.0'
spec.add_dependency 'rest-client', '~> 2.0.0'
spec.add_dependency 'azure_mgmt_compute', '~> 0.9.0'
spec.add_dependency 'azure_mgmt_resources', '~> 0.9.0'
spec.add_dependency 'azure_mgmt_storage', '~> 0.9.0'
Expand All @@ -33,6 +32,6 @@ Gem::Specification.new do |spec|
spec.add_dependency 'azure_mgmt_traffic_manager', '~> 0.9.0'
spec.add_dependency 'azure_mgmt_sql', '~> 0.9.0'
spec.add_dependency 'azure_mgmt_key_vault', '~> 0.9.0'
spec.add_dependency 'azure-storage', '>= 0.11.5.preview', '< 1.0'
spec.add_dependency 'azure-storage', '= 0.11.5.preview'
spec.add_dependency 'vhd', '0.0.4'
end
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def destroy

def update(profile_params)
validate_input(profile_params)
profile_params[:endpoints] = endpoints.map { |endpoint| get_hash_from_object(endpoint)['attributes'] }
profile_params[:endpoints] = endpoints.map { |endpoint| get_hash_from_object(endpoint)['attributes'] } unless endpoints.nil?
merge_attributes(profile_params)
profile = service.create_or_update_traffic_manager_profile(traffic_manager_profile_hash)
merge_attributes(Fog::TrafficManager::AzureRM::TrafficManagerProfile.parse(profile))
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/azurerm/utilities/general.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def raise_azure_exception(exception, msg)
end
exception_message = "Exception in #{msg} #{message} Type: #{exception.class}\n#{exception.backtrace.join("\n")}"
else
"#{exception.inspect}\n#{exception.backtrace.join("\n")}"
exception_message = "#{exception.inspect}\n#{exception.backtrace.join("\n")}"
end

Fog::Logger.debug exception.backtrace
Expand Down
2 changes: 1 addition & 1 deletion test/integration/application_gateway.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

resource = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/availability_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

rs = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/blob.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

rs = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

rs = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/data_disk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

rs = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/deployment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

resources = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/express_route_circuit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

resources = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/external_load_balancer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

rs = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/internal_load_balancer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

rs = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/key_vault.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

resources = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/local_network_gateway.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

resource = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/managed_disk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

rs = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/network_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

rs = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/network_security_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

rs = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/network_security_rule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

rs = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/public_ip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

rs = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/record_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

resource = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/resource_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

resource = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/resource_tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

resources = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

rs = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/server_custom_image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

rs = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/sql_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

resources = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/storage_account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

rs = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/subnet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

rs = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/traffic_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

resources = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/virtual_machine_extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

rs = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/virtual_network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

rs = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/virtual_network_gateway.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

resource = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/virtual_network_gateway_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

resource = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

resource = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/zone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################### Keep it Uncommented! ######################
########################################################################################################################

azure_credentials = YAML.load_file('credentials/azure.yml')
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

rs = Fog::Resources::AzureRM.new(
tenant_id: azure_credentials['tenant_id'],
Expand Down
2 changes: 1 addition & 1 deletion test/models/key_vault/test_vault.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class TestVault < Minitest::Test
def setup
@service = Fog::KeyVault::AzureRM.new(credentials)
@vault = Fog::KeyVault::AzureRM::Vault.new
@vault = key_vault(@service)
end

def test_model_attributes
Expand Down
Loading

0 comments on commit 72c7dd1

Please sign in to comment.