<commit_before>require 'test/unit'
require 'grabzit'

class GrabzItTest < Test::Unit::TestCase
	Cookie_Name = "test_cookie"
	Cookie_Domain = ".example.com"
	WaterMark_Identifier = "test_watermark"
	WaterMark_Path = "test/test.png"
	Screenshot_Path = "test/tmp.jpg"

	def setup
		@applicationKey = "<KEY>
		@applicationSecret = "<KEY>
		#Set to true if the account is subscribed
		@isSubscribedAccount = true
	end
	
	def test_application_key
		assert_not_nil(@applicationKey, "Please set your application key variable in the setup method. You can get a application key for free from: http://grabz.it")
	end

	def test_application_secret
		assert_not_nil(@applicationSecret, "Please set your application secret variable in the setup method. You can get a application key for free from: http://grabz.it")
	end

	def test_html_to_image
		assert_nothing_raised "An error occured when trying to take convert HTML to a image" do
			grabzItClient = GrabzIt::Client.new(@applicationKey, @applicationSecret)
			grabzItClient.html_to_image("<h1>Hello world</h1>");
			assert_not_equal(false, grabzItClient.save(), "HTML not converted")
		end		
	end

	def test_html_to_pdf
		assert_nothing_raised "An error occured when trying to take convert HTML to a pdf" do
			grabzItClient = GrabzIt::Client.new(@applicationKey, @applicationSecret)
			grabzItClient.html_to_pdf("<h1>Hello world</h1>");
			assert_not_equal(false, grabzItClient.save(), "HTML not converted")
		end		
	end
	<commit_msg>Version 3<commit_after>require 'test/unit'
require 'grabzit'

class GrabzItTest < Test::Unit::TestCase
	Cookie_Name = "test_cookie"
	Cookie_Domain = ".example.com"
	WaterMark_Identifier = "test_watermark"
	WaterMark_Path = "test/test.png"
	Screenshot_Path = "test/tmp.jpg"

	def setup
		@applicationKey = "YOUR APPLICATION KEY"
		@applicationSecret = "YOUR APPLICATION SECRET"
		#Set to true if the account is subscribed
		@isSubscribedAccount = false
	end
	
	def test_application_key
		assert_not_nil(@applicationKey, "Please set your application key variable in the setup method. You can get a application key for free from: http://grabz.it")
	end

	def test_application_secret
		assert_not_nil(@applicationSecret, "Please set your application secret variable in the setup method. You can get a application key for free from: http://grabz.it")
	end

	def test_html_to_image
		assert_nothing_raised "An error occured when trying to take convert HTML to a image" do
			grabzItClient = GrabzIt::Client.new(@applicationKey, @applicationSecret)
			grabzItClient.html_to_image("<h1>Hello world</h1>");
			assert_not_equal(false, grabzItClient.save(), "HTML not converted")
		end		
	end

	def test_html_to_pdf
		assert_nothing_raised "An error occured when trying to take convert HTML to a pdf" do
			grabzItClient = GrabzIt::Client.new(@applicationKey, @applicationSecret)
			grabzItClient.html_to_pdf("<h1>Hello world</h1>");
			assert_not_equal(false, grabzItClient.save(), "HTML not converted")
		end		
	end
	
{'fraction_non_alphanumeric': 0.08847184986595175, 'fraction_numerical': 0.0030160857908847183, 'mean_word_length': 5.21875, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 13, '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': '4894617', 'n_tokens_mistral': 1025, 'n_tokens_neox': 950, 'n_words': 281}