<commit_before>import mock
import zeit.brightcove.convert
import zeit.brightcove.testing
import zeit.cms.testing
import zope.testbrowser.testing


class NotificationTest(zeit.cms.testing.BrowserTestCase):

    layer = zeit.brightcove.testing.LAYER

    def test_runs_import_as_system_user(self):
        # View is available without authentication
        b = zope.testbrowser.testing.Browser()
        with mock.patch.object(
                zeit.brightcove.update.import_video_async,
                '__call__') as import_video:
            b.post('http://localhost/@@update_video',
                   '{"event": "video-change", "video": "myvid"}',
                   'application/x-javascript')
            self.assertEqual('myvid', import_video.call_args[0][0])<commit_msg>MAINT: Update to changed zeit.cms test browser setup API<commit_after>import mock
import zeit.brightcove.convert
import zeit.brightcove.testing
import zeit.cms.testing


class NotificationTest(zeit.cms.testing.BrowserTestCase):

    layer = zeit.brightcove.testing.LAYER

    def test_runs_import_as_system_user(self):
        # View is available without authentication
        b = zeit.cms.testing.Browser()
        with mock.patch.object(
                zeit.brightcove.update.import_video_async,
                '__call__') as import_video:
            b.post('http://localhost/@@update_video',
                   '{"event": "video-change", "video": "myvid"}',
                   'application/x-javascript')
            self.assertEqual('myvid', import_video.call_args[0][0])
{'fraction_non_alphanumeric': 0.11061093247588424, 'fraction_numerical': 0.002572347266881029, 'mean_word_length': 2.832512315270936, 'pattern_counts': {'":': 4, '<': 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': '2131610', 'n_tokens_mistral': 472, 'n_tokens_neox': 439, 'n_words': 79}