<commit_before>import unittest

class LegacyViewTests(unittest.TestCase):
    def _makeOne(self, app):
        from pylons.views import LegacyView
        return LegacyView(app)

    def test_it(self):
        request = DummyRequest()
        view = self._makeOne(dummyapp)
        response = view(request)
        self.assertEqual(response, dummyapp)

class Test_expose(unittest.TestCase):
    def _makeOne(self, **kw):
        from pylons.views import action
        return action(**kw)

    def test_call(self):
        inst = self._makeOne(a=1, b=2)
        def wrapped():
            """ """
        result = inst(wrapped)
        self.failUnless(result is wrapped)
        self.assertEqual(result.__exposed__, [{'a':1, 'b':2}])

def dummyapp(environ, start_response):
    """ """

class DummyRequest:
    def get_response(self, application):
        return application
<commit_msg>Coverage.<commit_after>import unittest

class LegacyViewTests(unittest.TestCase):
    def _makeOne(self, app):
        from pylons.views import LegacyView
        return LegacyView(app)

    def test_it(self):
        request = DummyRequest()
        view = self._makeOne(dummyapp)
        response = view(request)
        self.assertEqual(response, dummyapp)

class Test_action(unittest.TestCase):
    def _makeOne(self, **kw):
        from pylons.views import action
        return action(**kw)

    def test_call_no_previous__exposed__(self):
        inst = self._makeOne(a=1, b=2)
        def wrapped():
            """ """
        result = inst(wrapped)
        self.failUnless(result is wrapped)
        self.assertEqual(result.__exposed__, [{'a':1, 'b':2}])

    def test_call_with_previous__exposed__(self):
        inst = self._makeOne(a=1, b=2)
        def wrapped():
            """ """
        wrapped.__exposed__ = [None]
        result = inst(wrapped)
        self.failUnless(result is wrapped)
        self.assertEqual(result.__exposed__, [None, {'a':1, 'b':2}])

def dummyapp(environ, start_response):
    """ """

class DummyRequest:
    def get_response(self, application):
        return application

{'fraction_non_alphanumeric': 0.11918328584995251, 'fraction_numerical': 0.005698005698005698, 'mean_word_length': 2.769230769230769, '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': '4308554', 'n_tokens_mistral': 643, 'n_tokens_neox': 618, 'n_words': 136}