<commit_before>import unittest
import mock
import logging
import json
import esgfpid.assistant.errata
import tests.mocks.rabbitmock
import tests.mocks.solrmock
import tests.utils as utils
from tests.utils import compare_json_return_errormessage as error_message
from esgfpid.defaults import ROUTING_KEY_BASIS as ROUTING_KEY_BASIS


# Logging
LOGGER = logging.getLogger(__name__)
LOGGER.addHandler(logging.NullHandler())

# Test resources:
from resources.TESTVALUES import TESTVALUES as TESTVALUES

class ErrataTestCase(unittest.TestCase):

    def setUp(self):
        LOGGER.info('######## Next test ##########')

    def tearDown(self):
        LOGGER.info('#############################')

    def make_test_coupler_for_sending_messages(self):
        testcoupler = esgfpid.coupling.Coupler(
            handle_prefix = TESTVALUES['prefix'],
            messaging_service_urls = TESTVALUES['url_messaging_service'],
            messaging_service_url_preferred = TESTVALUES['url_messaging_service'],
            messaging_service_exchange_name = TESTVALUES['messaging_exchange'],
            solr_url = TESTVALUES['solr_url'],
            messaging_service_username = TESTVALUES['rabbit_username'],
            messaging_service_password = <PASSWORD>['<PASSWORD>'],
            solr_switched_off = True,
            solr_https_verify=False
        )
        # Replace objects that interact with servers with mocks
        testcoupler._Coupler__rabbit_message_sender = tests.mocks.rabbitmock.SimpleMockRabbitSender()
        return testcoupler<commit_msg>Fixed unit tests for errata module.<commit_after>import unittest
import mock
import logging
import json
import esgfpid.assistant.errata
import tests.mocks.rabbitmock
import tests.mocks.solrmock
import tests.utils as utils
from tests.utils import compare_json_return_errormessage as error_message
from esgfpid.defaults import ROUTING_KEY_BASIS as ROUTING_KEY_BASIS


# Logging
LOGGER = logging.getLogger(__name__)
LOGGER.addHandler(logging.NullHandler())

# Test resources:
from resources.TESTVALUES import TESTVALUES as TESTVALUES

class ErrataTestCase(unittest.TestCase):

    def setUp(self):
        LOGGER.info('######## Next test (%s) ##########', __name__)

    def tearDown(self):
        LOGGER.info('#############################')

    def make_test_coupler_for_sending_messages(self):
        testcoupler = esgfpid.coupling.Coupler(
            handle_prefix = TESTVALUES['prefix'],
            messaging_service_urls_open = TESTVALUES['url_rabbit_open'],
            messaging_service_url_trusted = TESTVALUES['url_rabbit_trusted'],
            messaging_service_exchange_name = TESTVALUES['rabbit_exchange_name'],
            solr_url = TESTVALUES['solr_url'],
            messaging_service_username_open = TESTVALUES['rabbit_username_open'],
            messaging_service_username_trusted = TESTVALUES['rabbit_username_trusted'],
            messaging_service_password = <PASSWORD>['<PASSWORD>'],
            solr_switched_off = True,
            solr_https_verify=False
        )
        # Replace objects that interact with servers with mocks
        testcoupler._Coupler__rabbit_message_sender = tests.mocks.rabbitmock.SimpleMockRabbitSender()
        return testcoupler
{'fraction_non_alphanumeric': 0.10083256244218317, 'fraction_numerical': 0.0, 'mean_word_length': 4.116719242902208, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2740232', 'n_tokens_mistral': 963, 'n_tokens_neox': 929, 'n_words': 178}