<commit_before># -*- coding: utf-8 -*-

from jool.directory import Location

def test_generate_temp_directory_name():
    l = Location()
    assert l.generate_temp_directory_name().startswith(l.PREFIX)
<commit_msg>test(directory): create and delete temporary directory<commit_after># -*- coding: utf-8 -*-

import os, shutil
from jool.directory import Location

def test_set_directory():
    l = Location()
    value = 'sthrandom'
    l.directory = value
    assert l.directory == value

def test_generate_temp_directory_name():
    l = Location()
    assert l.generate_temp_directory_name().startswith("%s/%s" % (l.BASE_DIR, l.PREFIX))

def test_create_remove_temp_directory():
    l = Location()
    l.directory = l.generate_temp_directory_name()

    l.create_temp_directory()
    assert os.path.exists(l.directory)
    l.remove_temp_directory()
    assert not os.path.exists(l.directory)

{'fraction_non_alphanumeric': 0.11995515695067265, 'fraction_numerical': 0.002242152466367713, 'mean_word_length': 4.284023668639053, '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': '6166034', 'n_tokens_mistral': 281, 'n_tokens_neox': 279, 'n_words': 60}