<commit_before>package br.usp.ime.choreos.nodepoolmanager.utils;

import static org.junit.Assert.assertEquals;

import java.io.File;

import org.apache.commons.io.FileUtils;
import org.junit.Test;

public class ScriptsProviderTest {

    @Test
    public void chefScript() throws Exception {
        String result = new ScriptsProvider().chefStartupScript("chef/testkey.txt");

        File f = new File(ClassLoader.getSystemResource("chef/test_startup_script_result.txt").getFile());
        String expected = FileUtils.readFileToString(f);
        
        assertEquals(expected, result);
    }

    @Test(expected = Exception.class)
    public void chefScriptInvalidKeyFile() throws Exception {
        new ScriptsProvider().chefStartupScript("not_found");
    }
}<commit_msg>Fixing testkey file location.<commit_after>package br.usp.ime.choreos.nodepoolmanager.utils;

import static org.junit.Assert.assertEquals;

import java.io.File;

import org.apache.commons.io.FileUtils;
import org.junit.Test;

public class ScriptsProviderTest {

    @Test
    public void chefScript() throws Exception {
        String testKeyFile = ClassLoader.getSystemResource("chef/testkey.txt").getFile();
        String result = new ScriptsProvider().chefStartupScript(testKeyFile);

        String scriptFile = ClassLoader.getSystemResource("chef/test_startup_script_result.txt").getFile();
        String expected = FileUtils.readFileToString(new File(scriptFile));

        assertEquals(expected, result);
    }

    @Test(expected = Exception.class)
    public void chefScriptInvalidKeyFile() throws Exception {
        new ScriptsProvider().chefStartupScript("not_found");
    }
}
{'fraction_non_alphanumeric': 0.10365488316357101, 'fraction_numerical': 0.0, 'mean_word_length': 4.138461538461539, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6725474', 'n_tokens_mistral': 476, 'n_tokens_neox': 467, 'n_words': 90}