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

Some functions to test the collectr library.

:copyright: (c) 2013 <NAME>
:license: MIT License, for details see LICENSE.
"""
import unittest
import collectr


class CollectrTest(unittest.TestCase):
    """
    Tests for the collectr library.
    """
    def setUp(self):
        self.dir = collectr.StaticDir('test/fixtures/dirB')

    def tearDown(self):
        self.dir = None

        try:          # Delete the files if they exist, otherwise mask failure.
            self.old_call('rm -rf test/fixtures/dirB/css')
            self.old_call('rm -rf test/fixtures/dirB/js')
        except OSError:
            pass<commit_msg>Stub out subprocess.call in tests.<commit_after># -*- coding: utf-8 -*-
"""
test_collectr
-------------

Some functions to test the collectr library.

:copyright: (c) 2013 <NAME>
:license: MIT License, for details see LICENSE.
"""
import unittest
import collectr
import subprocess
import mock


class CollectrTest(unittest.TestCase):
    """
    Tests for the collectr library.
    """
    def setUp(self):
        self.old_call = subprocess.call
        subprocess.call = mock.MagicMock(return_value=0)
        self.dir = collectr.StaticDir('test/fixtures/dirB')

    def tearDown(self):
        self.dir = None

        try:          # Delete the files if they exist, otherwise mask failure.
            self.old_call('rm -rf test/fixtures/dirB/css')
            self.old_call('rm -rf test/fixtures/dirB/js')
        except OSError:
            pass
{'fraction_non_alphanumeric': 0.12676962676962678, 'fraction_numerical': 0.007078507078507079, 'mean_word_length': 2.402625820568928, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3900349', 'n_tokens_mistral': 480, 'n_tokens_neox': 463, 'n_words': 131}