<commit_before>module Fog
  module Compute
    class OpenStack
      class Real
        def get_volume_details(volume_id)
          request(
            :expects  => 200,
            :method   => 'GET',
            :path     => "os-volumes/#{volume_id}"
          )
        end
      end

      class Mock
        def get_volume_details(volume_id)
          response = Excon::Response.new
          if data = self.data[:volumes][volume_id]
            response.status = 200
            response.body = { 'volume' => data }
            response
          else
            raise Fog::Compute::OpenStack::NotFound
          end
        end
      end
    end
  end
end<commit_msg>fix mock volume status when status = 'creating'<commit_after>module Fog
  module Compute
    class OpenStack
      class Real
        def get_volume_details(volume_id)
          request(
            :expects  => 200,
            :method   => 'GET',
            :path     => "os-volumes/#{volume_id}"
          )
        end
      end

      class Mock
        def get_volume_details(volume_id)
          response = Excon::Response.new
          if data = self.data[:volumes][volume_id]
            if data['status'] == 'creating' \
               && Time.now - Time.parse(data['createdAt']) >= Fog::Mock.delay
              data['status'] = 'available'
            end
            response.status = 200
            response.body = { 'volume' => data }
            response
          else
            raise Fog::Compute::OpenStack::NotFound
          end
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.09369024856596558, 'fraction_numerical': 0.0076481835564053535, 'mean_word_length': 1.4569640062597808, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '2765174', 'n_tokens_mistral': 442, 'n_tokens_neox': 427, 'n_words': 100}