<commit_before>#!/usr/bin/env python
# coding: utf-8

import os
import tempfile
import shutil
import pytest
import mock

from infect import infect


class TestSymlink(object):
    """
    Test the internal infect symlinker.

    These tests will actually use the os interface rather than mocking it out.
    This is mainly to make sure that these tests are not 90% mocking code.

    """

    def setup_method(self, method):
        self.infect = infect.Infect(mock.MagicMock())
        self.tempdir = tempfile.mkdtemp(
            prefix='infect-{0}-'.format(method.__name__)
        )

        # Store [1] to get the name only
        self.target = tempfile.mkstemp(dir=self.tempdir)[1]
        self.dest = os.path.join(self.tempdir, 'target')

    def teardown_method(self, method):
        # Try to tear down the temporary directory. Don't care if it fails.
        try:<commit_msg>Rename old symlink test class to be internal<commit_after>#!/usr/bin/env python
# coding: utf-8

import os
import tempfile
import shutil
import pytest
import mock

from infect import infect


class TestSymlinkInternal(object):
    """
    Test the internal infect symlinker.

    These tests will actually use the os interface rather than mocking it out.
    This is mainly to make sure that these tests are not 90% mocking code.

    """

    def setup_method(self, method):
        self.infect = infect.Infect(mock.MagicMock())
        self.tempdir = tempfile.mkdtemp(
            prefix='infect-{0}-'.format(method.__name__)
        )

        # Store [1] to get the name only
        self.target = tempfile.mkstemp(dir=self.tempdir)[1]
        self.dest = os.path.join(self.tempdir, 'target')

    def teardown_method(self, method):
        # Try to tear down the temporary directory. Don't care if it fails.
        try:
{'fraction_non_alphanumeric': 0.09166206515737162, 'fraction_numerical': 0.006626173384870237, 'mean_word_length': 2.790794979079498, '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': '4781849', 'n_tokens_mistral': 553, 'n_tokens_neox': 523, 'n_words': 182}