<commit_before>require "helpers/integration_test_helper"
require "helpers/client_helper"
require "securerandom"

class TestComputeAddressShared < FogIntegrationTest
  DEFAULT_REGION = "us-central1".freeze
  ADDRESS_RESOURCE_PREFIX = "fog-test-address".freeze

  include ClientHelper

  def delete_test_resources
    client = Fog::Compute::Google.new
    addresses = client.addresses.all(:region => DEFAULT_REGION)
    unless addresses.nil?
      addresses
        .select { |a| a.name.start_with?(ADDRESS_RESOURCE_PREFIX) }
        .each do |a|
          Fog.wait_for do
            unless a.ready?
              false
            end

            begin
              client.delete_address(a.name, DEFAULT_REGION)
            rescue ::Google::Apis::ClientError => e
              if e.status_code == 400 || e.status_code == 404
                return e.status_code == 404
              end<commit_msg>Changed resource prefix due to clashing<commit_after>require "helpers/integration_test_helper"
require "helpers/client_helper"
require "securerandom"

class TestComputeAddressShared < FogIntegrationTest
  DEFAULT_REGION = "us-central1".freeze
  ADDRESS_RESOURCE_PREFIX = "fog-int-test-address".freeze

  include ClientHelper

  def delete_test_resources
    client = Fog::Compute::Google.new
    addresses = client.addresses.all(:region => DEFAULT_REGION)
    unless addresses.nil?
      addresses
        .select { |a| a.name.start_with?(ADDRESS_RESOURCE_PREFIX) }
        .each do |a|
          Fog.wait_for do
            unless a.ready?
              false
            end

            begin
              client.delete_address(a.name, DEFAULT_REGION)
            rescue ::Google::Apis::ClientError => e
              if e.status_code == 400 || e.status_code == 404
                return e.status_code == 404
              end
{'fraction_non_alphanumeric': 0.08679039301310043, 'fraction_numerical': 0.010917030567685589, 'mean_word_length': 2.4519774011299433, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6885060', 'n_tokens_mistral': 541, 'n_tokens_neox': 528, 'n_words': 108}