<commit_before>import time
import unittest
from unittest.mock import Mock

import stomp
from stomp import exception
from stomp.listener import TestListener
from stomp.test.testutils import *


class Test12Connect(unittest.TestCase):

    def setUp(self):
        conn = stomp.Connection12(get_default_host(), vhost=get_default_vhost())
        listener = TestListener('123')
        conn.set_listener('', listener)
        conn.start()
        conn.connect(get_default_user(), get_default_password(), wait=True)
        self.conn = conn
        self.listener = listener
        self.timestamp = time.strftime('%Y%m%d%H%M%S')

    def tearDown(self):
        if self.conn:
            self.conn.disconnect(receipt=None)

    def test_send(self):<commit_msg>tests: Support mock in addition to unittest.mock in s12_test<commit_after>import time
import unittest
try:
    from unittest.mock import Mock
except ImportError:
    from mock import Mock

import stomp
from stomp import exception
from stomp.listener import TestListener
from stomp.test.testutils import *


class Test12Connect(unittest.TestCase):

    def setUp(self):
        conn = stomp.Connection12(get_default_host(), vhost=get_default_vhost())
        listener = TestListener('123')
        conn.set_listener('', listener)
        conn.start()
        conn.connect(get_default_user(), get_default_password(), wait=True)
        self.conn = conn
        self.listener = listener
        self.timestamp = time.strftime('%Y%m%d%H%M%S')

    def tearDown(self):
        if self.conn:
            self.conn.disconnect(receipt=None)

    def test_send(self):
{'fraction_non_alphanumeric': 0.10037174721189591, 'fraction_numerical': 0.009913258983890954, 'mean_word_length': 3.3766937669376693, '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': '2846123', 'n_tokens_mistral': 498, 'n_tokens_neox': 474, 'n_words': 112}