<commit_before># -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015-2018 by ExopyHqcLegacy Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# -----------------------------------------------------------------------------
"""Tests for the ApplyMagFieldTask

"""
from multiprocessing import Event

import pytest
import enaml

from exopy.tasks.api import RootTask
from exopy.tasks.tasks.logic.loop_task import LoopTask
from exopy.testing.util import show_and_close_widget
from exopy_hqc_legacy.tasks.tasks.instr.apply_mag_field_task\
    import ApplyMagFieldTask

with enaml.imports():
    from exopy.tasks.tasks.logic.views.loop_view import LoopView
    from exopy_hqc_legacy.tasks.tasks.instr.views.apply_mag_field_view\
        import ApplyMagFieldView

from .instr_helper import (InstrHelper, InstrHelperStarter, DummyJob,
                           PROFILES, DRIVERS)


class TestApplyMagFieldTask(object):

    def setup(self):
        self.root = RootTask(should_stop=Event(), should_pause=Event())
        self.task = ApplyMagFieldTask(name='Test',
                                      parallel={'activated': False})
        self.root.add_child_task(0, self.task)

        self.root.run_time[DRIVERS] = {'Test': (InstrHelper(),
                                                InstrHelperStarter())}
        self.root.run_time[PROFILES] =\
            {'Test1':<commit_msg>for the test again<commit_after># -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015-2018 by ExopyHqcLegacy Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# -----------------------------------------------------------------------------
"""Tests for the ApplyMagFieldTask

"""
from multiprocessing import Event

import pytest
import enaml

from exopy.tasks.api import RootTask
from exopy.tasks.tasks.logic.loop_task import LoopTask
from exopy.testing.util import show_and_close_widget
from exopy_hqc_legacy.tasks.tasks.instr.apply_mag_field_task\
    import ApplyMagFieldTask

with enaml.imports():
    from exopy.tasks.tasks.logic.views.loop_view import LoopView
    from exopy_hqc_legacy.tasks.tasks.instr.views.apply_mag_field_view\
        import ApplyMagFieldView

from .instr_helper import (InstrHelper, InstrHelperStarter, DummyJob,
                           PROFILES, DRIVERS)


class TestApplyMagFieldTask(object):

    def setup(self):
        self.root = RootTask(should_stop=Event(), should_pause=Event())
        self.task = ApplyMagFieldTask(name='Test',
                                      parallel={'activated': False})
        self.root.add_child_task(0, self.task)

        self.root.run_time[DRIVERS] = {'Test': (InstrHelper,
                                                InstrHelperStarter())}
        self.root.run_time[PROFILES] =\
            {'Test1':
{'fraction_non_alphanumeric': 0.18077291600127754, 'fraction_numerical': 0.007026509102523155, 'mean_word_length': 2.05859375, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2555012', 'n_tokens_mistral': 874, 'n_tokens_neox': 831, 'n_words': 198}