<commit_before>"""
Tests for pika.adapters.tornado_connection

"""
from tornado import ioloop
import mock
try:
    import unittest2 as unittest
except ImportError:
    import unittest

from pika.adapters import tornado_connection


class TornadoConnectionTests(unittest.TestCase):

    @mock.patch('pika.adapters.base_connection.BaseConnection.__init__')
    def test_tornado_connection_call_parent(self, mock_init):
        obj = tornado_connection.TornadoConnection()
        mock_init.called_once_with(None, None, False)<commit_msg>Don't fail tornado tests if tornado is not installed, just skip them<commit_after>"""
Tests for pika.adapters.tornado_connection

"""
try:
    from tornado import ioloop
except ImportError:
    ioloop = None

import mock

try:
    import unittest2 as unittest
except ImportError:
    import unittest

try:
    from pika.adapters import tornado_connection
except ImportError:
    tornado_connection = None


class TornadoConnectionTests(unittest.TestCase):

    @unittest.skipIf(ioloop is None, 'requires Tornado')
    @mock.patch('pika.adapters.base_connection.BaseConnection.__init__')
    def test_tornado_connection_call_parent(self, mock_init):
        obj = tornado_connection.TornadoConnection()
        mock_init.called_once_with(None, None, False)
{'fraction_non_alphanumeric': 0.07519379844961241, 'fraction_numerical': 0.0015503875968992248, 'mean_word_length': 4.922018348623853, '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': '2606347', 'n_tokens_mistral': 408, 'n_tokens_neox': 385, 'n_words': 93}