<commit_before>require 'test_helper'
class TestCommand < Test::Unit::TestCase

	def test_csv2strings_with_multiple_2_languages
    options = {
    	:filename => "test/data/test_data_multiple_langs.csv",
    	:langs => {"English" => "en", "French" => "fr"}
    }
    CSV2StringsCommand.new([], options).csv2strings

		assert File.exist?("./en.lproj/Localizable.strings")
		assert File.exist?("./fr.lproj/Localizable.strings")

		#clean up
		system("rm -rf ./en.lproj/")
		system("rm -rf ./fr.lproj/")
	end

	def test_csv2strings_with_default_path
		options = {
    	:filename => "test/data/test_data_multiple_langs.csv",
    	:langs => {"English" => "en", "French" => "fr"},
    	:default_path => "mynewlocation"
    }
    CSV2StringsCommand.new([], options).csv2strings

		# testing
		assert File.exist?("./mynewlocation/en.lproj/Localizable.strings"), "can't find output file for English"
		assert File.exist?("./mynewlocation/fr.lproj/Localizable.strings"), "can't find output file for French"

		#clean up
		system("rm -rf ./mynewlocation")
	end

end
<commit_msg>ADD command test for google_doc<commit_after>require 'test_helper'
class TestCommand < Test::Unit::TestCase

	def test_csv2strings_with_multiple_2_languages
    options = {
    	:filename => "test/data/test_data_multiple_langs.csv",
    	:langs => {"English" => "en", "French" => "fr"}
    }
    CSV2StringsCommand.new([], options).csv2strings

		assert File.exist?("./en.lproj/Localizable.strings")
		assert File.exist?("./fr.lproj/Localizable.strings")

		#clean up
		system("rm -rf ./en.lproj/")
		system("rm -rf ./fr.lproj/")
	end

	def test_csv2strings_with_default_path
		options = {
    	:filename => "test/data/test_data_multiple_langs.csv",
    	:langs => {"English" => "en", "French" => "fr"},
    	:default_path => "mynewlocation"
    }
    CSV2StringsCommand.new([], options).csv2strings

		# testing
		assert File.exist?("./mynewlocation/en.lproj/Localizable.strings"), "can't find output file for English"
		assert File.exist?("./mynewlocation/fr.lproj/Localizable.strings"), "can't find output file for French"

		#clean up
		system("rm -rf ./mynewlocation")
	end

def test_csv2strings_with_fetch_google_doc
    options = {
      :filename => "my_trads",
      :langs => {"English" => "en", "French" => "fr"},
      :fetch => true
    }
    assert_nothing_raised do
      CSV2StringsCommand.new([], options).csv2strings
    end
  end
end

{'fraction_non_alphanumeric': 0.15791649441918149, 'fraction_numerical': 0.007027697395618024, 'mean_word_length': 3.849699398797595, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 26, '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': '1559512', 'n_tokens_mistral': 890, 'n_tokens_neox': 832, 'n_words': 158}