<commit_before>from unittest import mock, TestCase
from utils.all_files import all_files


class TestAllFiles(TestCase):

    @mock.patch("os.walk")
    def test_all_files(self, mock_os_walk):
        pa = "root/"
        mock_os_walk.return_value = iter([(pa, [], ['TP_VerbKick-F#3.wav', 'TP_RoomaKick-C4.wav', "data.csv"])])
        res = list(all_files(pa, [".wav"]))
        self.assertEquals(len(res), 2, "Unexpected number of elements returned: {}.".format(len(res)))
        self.assertTrue("root/TP_VerbKick-F#3.wav" in res)
        self.assertTrue("root/TP_RoomaKick-C4.wav" in res)
        self.assertFalse("root/data.csv" in res)
        mock_os_walk.assert_called_with(pa)<commit_msg>changed call to depreceated function<commit_after>from unittest import mock, TestCase
from utils.all_files import all_files


class TestAllFiles(TestCase):

    @mock.patch("os.walk")
    def test_all_files(self, mock_os_walk):
        pa = "root/"
        mock_os_walk.return_value = iter([(pa, [], ['TP_VerbKick-F#3.wav', 'TP_RoomaKick-C4.wav', "data.csv"])])
        res = list(all_files(pa, [".wav"]))
        self.assertEqual(len(res), 2, "Unexpected number of elements returned: {}.".format(len(res)))
        self.assertTrue("root/TP_VerbKick-F#3.wav" in res)
        self.assertTrue("root/TP_RoomaKick-C4.wav" in res)
        self.assertFalse("root/data.csv" in res)
        mock_os_walk.assert_called_with(pa)
{'fraction_non_alphanumeric': 0.15134370579915135, 'fraction_numerical': 0.007072135785007072, 'mean_word_length': 3.7324414715719065, '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': '4200740', 'n_tokens_mistral': 516, 'n_tokens_neox': 514, 'n_words': 89}