<commit_before>#
# mockapiclient.rb - This file contains the MockApiClient class.
#
# Copyright (C) 2011 MediaSift Ltd
#
# == Overview
#
# The MockApiClient class implements a fake DataSift API interface.

module DataSift
	# MockApiCLient class.
	#
	# == Introduction
	#
	# The ApiClient class implements a fake DataSift API interface.
	#
	class MockApiClient
		# Set the response to be returned by the call method
		# === Parameters
		#
		# * +code+ - The HTTP response code
		# * +data+ - The dictionary that would have come from the response body
		# * +rate_limit+ - The new rate_limit value
		# * +rate_limit_remaining+ - The new rate_limit_remaining value
		def setResponse(code, data, rate_limit, rate_limit_remaining)
			@response = {
				'response_code' => code,
				'data' => data,
				'rate_limit' => rate_limit,
				'rate_limit_remaining' => rate_limit_remaining,
			}
		end

		# Clear the response so we throw an exception if we get called again
		# without a new response being set.
		#
		def clearResponse()
			@response = false
		end

		# Fake a call to a DataSift API endpoint.
		# === Parameters
		#
		# * +endpoint+ - The endpoint of the API call.
		# * +params+ - The parameters to be passed along with the request.
		# * +username+ - The username for the Auth header
		# * +api_key+ - The API key for the Auth header
		def call(username, api_key, endpoint, params = {}, user_agent = 'DataSiftPHP/0.0', use_ssl = true)
			if !@response
				raise StandardError, 'Expected response not set in mock object'
			end
			@response
		end
	end
end<commit_msg>Removed the SSL option from the mock API client.<commit_after>#
# mockapiclient.rb - This file contains the MockApiClient class.
#
# Copyright (C) 2011 MediaSift Ltd
#
# == Overview
#
# The MockApiClient class implements a fake DataSift API interface.

module DataSift
	# MockApiCLient class.
	#
	# == Introduction
	#
	# The ApiClient class implements a fake DataSift API interface.
	#
	class MockApiClient
		# Set the response to be returned by the call method
		# === Parameters
		#
		# * +code+ - The HTTP response code
		# * +data+ - The dictionary that would have come from the response body
		# * +rate_limit+ - The new rate_limit value
		# * +rate_limit_remaining+ - The new rate_limit_remaining value
		def setResponse(code, data, rate_limit, rate_limit_remaining)
			@response = {
				'response_code' => code,
				'data' => data,
				'rate_limit' => rate_limit,
				'rate_limit_remaining' => rate_limit_remaining,
			}
		end

		# Clear the response so we throw an exception if we get called again
		# without a new response being set.
		#
		def clearResponse()
			@response = false
		end

		# Fake a call to a DataSift API endpoint.
		# === Parameters
		#
		# * +endpoint+ - The endpoint of the API call.
		# * +params+ - The parameters to be passed along with the request.
		# * +username+ - The username for the Auth header
		# * +api_key+ - The API key for the Auth header
		def call(username, api_key, endpoint, params = {}, user_agent = 'DataSiftPHP/0.0')
			if !@response
				raise StandardError, 'Expected response not set in mock object'
			end
			@response
		end
	end
end
{'fraction_non_alphanumeric': 0.09021842355175688, 'fraction_numerical': 0.003798670465337132, 'mean_word_length': 3.3706777316735823, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '5603456', 'n_tokens_mistral': 1094, 'n_tokens_neox': 985, 'n_words': 367}