<commit_before>from mock import patch

from django.test import TestCase, override_settings

from callisto_core.utils.api import MatchingApi


class ApiTest(TestCase):

    def test_abritrary_method_names_can_be_used(self):
        self.assertEqual(
            MatchingApi.send_claws_to_scratch_couch(),
            None,
        )

    @patch('callisto_core.reporting.api.CallistoCoreMatchingApi.find_matches')
    def test_default_api_call(self, mock_process):
        MatchingApi.find_matches('arg1')
        mock_process.assert_called_once_with('arg1')

    @override_settings(CALLISTO_MATCHING_API='callisto_core.tests.utils.api.CustomMatchingApi')
    @patch('callisto_core.tests.utils.api.CustomMatchingApi.find_matches')
    def test_overridden_api_call(self, mock_process):
        MatchingApi.find_matches('arg1')
        mock_process.assert_called_once_with('arg1')<commit_msg>$ make clean<commit_after>from mock import patch

from django.test import TestCase, override_settings

from callisto_core.utils.api import MatchingApi


class ApiTest(TestCase):

    def test_abritrary_method_names_can_be_used(self):
        self.assertEqual(
            MatchingApi.send_claws_to_scratch_couch(),
            None,
        )

    @patch('callisto_core.reporting.api.CallistoCoreMatchingApi.find_matches')
    def test_default_api_call(self, mock_process):
        MatchingApi.find_matches('arg1')
        mock_process.assert_called_once_with('arg1')

    @override_settings(
        CALLISTO_MATCHING_API='callisto_core.tests.utils.api.CustomMatchingApi')
    @patch('callisto_core.tests.utils.api.CustomMatchingApi.find_matches')
    def test_overridden_api_call(self, mock_process):
        MatchingApi.find_matches('arg1')
        mock_process.assert_called_once_with('arg1')
{'fraction_non_alphanumeric': 0.08800448430493274, 'fraction_numerical': 0.004484304932735426, 'mean_word_length': 4.442073170731708, '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': '6328538', 'n_tokens_mistral': 578, 'n_tokens_neox': 563, 'n_words': 68}