def test_apply_mag_field_view1(windows, root_view, task_workbench):
    """Test ApplyMagFieldView widget outisde of a LoopTask.

    """
    task = ApplyMagFieldTask(name='Test')
    root_view.task.add_child_task(0, task)
    show_and_close_widget(ApplyMagFieldView(task=task, root=root_view))
Esempio n. 2
0
    def test_view(self, windows, task_workbench):
        """Test the LoopTask view.

        """
        core = task_workbench.get_plugin('enaml.workbench.core')
        root = RootTaskView(core=core)
        show_and_close_widget(LoopView(task=self.task, root=root))
Esempio n. 3
0
    def test_view(self, windows, task_workbench):
        """Test the LoopTask view.

        """
        core = task_workbench.get_plugin('enaml.workbench.core')
        root = RootTaskView(core=core)
        show_and_close_widget(LoopView(task=self.task, root=root))
Esempio n. 4
0
def test_rf_output_view(windows, root_view, task_workbench):
    """Test RFSetOnOffView widget outisde of a LoopTask.

    """
    task = SetRFOnOffTask(name='Test')
    root_view.task.add_child_task(0, task)
    show_and_close_widget(RFSetOnOffView(task=task, root=root_view))
Esempio n. 5
0
def test_loop_config(app, task_workbench):
    """Test the loop config.

    """
    plugin = task_workbench.get_plugin("ecpy.tasks")

    config = LoopTaskConfig(manager=plugin, task_class=plugin.get_task("ecpy.LoopTask"))

    assert config.task_name
    assert config.ready
    assert config.task_doc

    config.task_name = ""
    assert not config.ready

    config.task_name = "Test"
    task = config.build_task()
    assert task.name == "Test"

    plugin.auto_task_names = []
    config = LoopTaskConfig(manager=plugin, task_class=plugin.get_task("ecpy.LoopTask"))

    assert not config.task_name
    assert not config.ready

    show_and_close_widget(LoopConfigView(config=config))
Esempio n. 6
0
def test_rf_frequency_view(windows, root_view, task_workbench):
    """Test SetRFFrequencyTask widget outisde of a LoopTask.

    """
    task = SetRFFrequencyTask(name='Test')
    root_view.task.add_child_task(0, task)
    show_and_close_widget(RFFrequencyView(task=task, root=root_view))
Esempio n. 7
0
def test_py_task_config(app, task_workbench):
    """Test the basic python task configurer.

    """
    plugin = task_workbench.get_plugin('ecpy.tasks')

    config = PyTaskConfig(manager=plugin,
                          task_class=plugin.get_task('ecpy.ComplexTask'))

    assert config.task_name
    assert config.ready
    assert config.task_doc

    config.task_name = ''
    assert not config.ready

    config.task_name = 'Test'
    task = config.build_task()
    assert task.name == 'Test'

    plugin.auto_task_names = []
    config = PyTaskConfig(manager=plugin,
                          task_class=plugin.get_task('ecpy.ComplexTask'))

    assert not config.task_name
    assert not config.ready

    show_and_close_widget(PyConfigView(config=config))
    show_and_close_widget(PyConfigView(config=config, loop=True))
Esempio n. 8
0
def test_loop_config(app, task_workbench):
    """Test the loop config.

    """
    plugin = task_workbench.get_plugin('ecpy.tasks')

    config = LoopTaskConfig(manager=plugin,
                            task_class=plugin.get_task('ecpy.LoopTask'))

    assert config.task_name
    assert config.ready
    assert config.task_doc

    config.task_name = ''
    assert not config.ready

    config.task_name = 'Test'
    task = config.build_task()
    assert task.name == 'Test'

    plugin.auto_task_names = []
    config = LoopTaskConfig(manager=plugin,
                            task_class=plugin.get_task('ecpy.LoopTask'))

    assert not config.task_name
    assert not config.ready

    show_and_close_widget(LoopConfigView(config=config))
Esempio n. 9
0
def test_lock_in_meas_view1(windows, root_view, task_workbench):
    """Test LockInMeasView widget outisde of a LoopTask.

    """
    task = LockInMeasureTask(name="Test")
    root_view.task.add_child_task(0, task)
    show_and_close_widget(LockInMeasView(task=task, root=root_view))
Esempio n. 10
0
def test_set_dc_voltage_view(windows, root_view, task_workbench):
    """Test RFPowerView widget outisde of a LoopTask.

    """
    task = SetDCVoltageTask(name='Test')
    root_view.task.add_child_task(0, task)
    show_and_close_widget(SetDcVoltageView(task=task, root=root_view))
Esempio n. 11
0
def test_save_array_view(windows, root_view):
    """Test SaveView widget.

    """
    task = SaveArrayTask(name='Test')
    root_view.task.add_child_task(0, task)
    show_and_close_widget(SaveArrayView(task=task, root=root_view))
Esempio n. 12
0
def test_py_task_config(app, task_workbench):
    """Test the basic python task configurer.

    """
    plugin = task_workbench.get_plugin('ecpy.tasks')

    config = PyTaskConfig(manager=plugin,
                          task_class=plugin.get_task('ecpy.ComplexTask'))

    assert config.task_name
    assert config.ready
    assert config.task_doc

    config.task_name = ''
    assert not config.ready

    config.task_name = 'Test'
    task = config.build_task()
    assert task.name == 'Test'

    plugin.auto_task_names = []
    config = PyTaskConfig(manager=plugin,
                          task_class=plugin.get_task('ecpy.ComplexTask'))

    assert not config.task_name
    assert not config.ready

    show_and_close_widget(PyConfigView(config=config))
    show_and_close_widget(PyConfigView(config=config, loop=True))
Esempio n. 13
0
def test_tree_widget(windows):
    """Test the ConditionalTask view.

    """
    with enaml.imports():
        from .test_tree_widget import Main
    show_and_close_widget(Main())
Esempio n. 14
0
def test_autoscroll(windows):
    """Test the ConditionalTask view.

    """
    with enaml.imports():
        from .test_autoscroll_html import Main
    show_and_close_widget(Main())
Esempio n. 15
0
def test_pna_single_point_view(windows, root_view, task_workbench):
    """Test PNA single point meas view no measure.

    """
    task = PNASinglePointMeasureTask(name='Test')
    root_view.task.add_child_task(0, task)
    show_and_close_widget(PNASinglePointView(task=task, root=root_view))
Esempio n. 16
0
def test_meas_dc_voltage_view(windows, root_view, task_workbench):
    """Test MeasDCVoltView widget outisde of a LoopTask.

    """
    task = MeasDCVoltageTask(name='Test')
    root_view.task.add_child_task(0, task)
    show_and_close_widget(MeasDCVoltView(task=task, root=root_view))
Esempio n. 17
0
def test_pna_single_point_view2(windows, root_view, task_workbench):
    """Test PNA single point meas view.

    """
    task = PNASinglePointMeasureTask(name='Test')
    task.measures = [('S21', ''), ('S43', 'MLIN')]
    root_view.task.add_child_task(0, task)
    show_and_close_widget(PNASinglePointView(task=task, root=root_view))
Esempio n. 18
0
def test_pna_frequency_view(windows, root_view, task_workbench):
    """Test PNA frequency interface widget outisde of a LoopTask.

    """
    task = SetRFFrequencyTask(name='Test')
    task.interface = PNASetRFFrequencyInterface(task=task)
    root_view.task.add_child_task(0, task)
    show_and_close_widget(RFFrequencyView(task=task, root=root_view))
Esempio n. 19
0
def test_pna_power_view(windows, root_view, task_workbench):
    """Test PNA power interface widget outisde of a LoopTask.

    """
    task = SetRFPowerTask(name='Test')
    task.interface = PNASetRFPowerInterface(task=task)
    root_view.task.add_child_task(0, task)
    show_and_close_widget(RFPowerView(task=task, root=root_view))
def test_apply_mag_field_view2(windows, root_view, task_workbench):
    """Test ApplyMagFieldView widget inside of a LoopTask.

    """
    task = ApplyMagFieldTask(name='Test')
    loop = LoopTask(name='r', task=task)
    root_view.task.add_child_task(0, loop)
    # XXX check for absence of target field
    show_and_close_widget(LoopView(task=loop, root=root_view))
Esempio n. 21
0
def test_array_find_value_view(windows):
    """Test the array extrema view.

    """
    root = RootTask(should_stop=Event(), should_pause=Event())
    task = ArrayFindValueTask(name="Test")
    root.children.append(task)

    show_and_close_widget(ArrayFindValueView(task=task))
Esempio n. 22
0
    def test_view_interface_not_inline(self, windows, task_workbench,
                                       linspace_interface):
        """Test the LoopTask view.

        """
        core = task_workbench.get_plugin('enaml.workbench.core')
        root = RootTaskView(core=core)
        self.task.interface = linspace_interface
        show_and_close_widget(LoopView(task=self.task, root=root))
Esempio n. 23
0
def test_rf_frequency_view2(windows, root_view, task_workbench):
    """Test SetRFFrequencyTask widget inside of a LoopTask.

    """
    task = SetRFFrequencyTask(name='Test')
    loop = LoopTask(name='r', task=task)
    root_view.task.add_child_task(0, loop)
    # XXX check for absence of target field
    show_and_close_widget(LoopView(task=loop, root=root_view))
Esempio n. 24
0
def test_rf_power_view2(windows, root_view, task_workbench):
    """Test RFPowerView widget inside of a LoopTask.

    """
    task = SetDCVoltageTask(name='Test')
    interface = MultiChannelVoltageSourceInterface(task=task)
    task.interface = interface
    loop = LoopTask(name='r', task=task)
    root_view.task.add_child_task(0, loop)
    # XXX check for absence of target field
    show_and_close_widget(LoopView(task=loop, root=root_view))
Esempio n. 25
0
def test_template_task_config(app, task_workbench):
    """Test the template task configurer.

    """
    plugin = task_workbench.get_plugin('ecpy.tasks')

    path = os.path.join(os.path.dirname(__file__), 'test_template.task.ini')
    config = TemplateTaskConfig(manager=plugin, template_path=path)
    assert config.template_doc
    task = config.build_task()
    assert len(task.children) == 1

    show_and_close_widget(TemplateConfigView(config=config))
Esempio n. 26
0
def test_conditional_sequence_view(windows, workbench, root,
                                   process_and_sleep):
    """Test the view of the Pulse class.

    """
    import enaml
    from ecpy.testing.util import show_and_close_widget
    with enaml.imports():
        from ecpy_pulses.pulses.sequences.views.base_sequences_views\
            import RootSequenceView

    core = workbench.get_plugin('enaml.workbench.core')
    root.add_child_item(0, ConditionalSequence())
    show_and_close_widget(RootSequenceView(item=root, core=core))
Esempio n. 27
0
def test_text_monitor_declration_functions(text_monitor_workbench):
    """Test that we can create a monitor and its views.

    """
    m_p = text_monitor_workbench.get_plugin('ecpy.measure')
    decl = m_p.get_declarations('monitor',
                                ['ecpy.text_monitor'])['ecpy.text_monitor']
    mon = decl.new(text_monitor_workbench, False)
    assert isinstance(mon, TextMonitor)
    edit_view = decl.make_view(text_monitor_workbench, mon)
    assert isinstance(edit_view, TextMonitorEdit)
    item = decl.create_item(text_monitor_workbench, None)
    assert isinstance(item, TextMonitorItem)
    show_and_close_widget(DockItemTestingWindow(widget=item))
def test_conditional_sequence_view(windows, workbench, root,
                                   process_and_sleep):
    """Test the view of the Pulse class.

    """
    import enaml
    from ecpy.testing.util import show_and_close_widget
    with enaml.imports():
        from ecpy_pulses.pulses.sequences.views.base_sequences_views\
            import RootSequenceView

    core = workbench.get_plugin('enaml.workbench.core')
    root.add_child_item(0, ConditionalSequence())
    show_and_close_widget(RootSequenceView(item=root, core=core))
Esempio n. 29
0
def test_template_task_config(app, task_workbench):
    """Test the template task configurer.

    """
    plugin = task_workbench.get_plugin('ecpy.tasks')

    path = os.path.join(os.path.dirname(__file__),
                        'test_template.task.ini')
    config = TemplateTaskConfig(manager=plugin,
                                template_path=path)
    assert config.template_doc
    task = config.build_task()
    assert len(task.children) == 1

    show_and_close_widget(TemplateConfigView(config=config))
Esempio n. 30
0
def test_reporting_on_extension_errors(windows, instr_workbench):
    """Check reporting extension errors.

    """
    plugin = instr_workbench.get_plugin('ecpy.app.errors')
    handler = plugin._errors_handlers.contributions['ecpy.driver-validation']

    widget = handler.report(instr_workbench)
    assert isinstance(widget, MultilineField)
    show_and_close_widget(widget)

    handler.errors = {'test': 'msg'}

    widget = handler.report(instr_workbench)
    assert isinstance(widget, BasicErrorsDisplay)
    show_and_close_widget(widget)
Esempio n. 31
0
def test_pulse_view2(windows, workbench, pulse):
    """Test showing a pulse logical at the start.

    """
    import enaml
    from ecpy.testing.util import show_and_close_widget
    with enaml.imports():
        from ecpy_pulses.pulses.sequences.views.base_sequences_views\
            import RootSequenceView

    pulse.kind = 'Logical'
    root = pulse.root
    root.add_child_item(0, pulse)
    core = workbench.get_plugin('enaml.workbench.core')
    root_view = RootSequenceView(item=root, core=core)
    show_and_close_widget(root_view)
Esempio n. 32
0
def test_pulse_view2(windows, workbench, pulse):
    """Test showing a pulse logical at the start.

    """
    import enaml
    from ecpy.testing.util import show_and_close_widget
    with enaml.imports():
        from ecpy_pulses.pulses.sequences.views.base_sequences_views\
            import RootSequenceView

    pulse.kind = 'Logical'
    root = pulse.root
    root.add_child_item(0, pulse)
    core = workbench.get_plugin('enaml.workbench.core')
    root_view = RootSequenceView(item=root, core=core)
    show_and_close_widget(root_view)
Esempio n. 33
0
def test_reporting_on_extension_errors(err_workbench):
    """Check reporting extension errors.

    """
    plugin = err_workbench.get_plugin('ecpy.app.errors')
    handler = plugin._errors_handlers.contributions['extensions']

    widget = handler.report(err_workbench)
    assert isinstance(widget, MultilineField)
    show_and_close_widget(widget)

    handler.errors = {'test': {'errror': 'msg'}}

    widget = handler.report(err_workbench)
    assert isinstance(widget, HierarchicalErrorsDisplay)
    show_and_close_widget(widget)
def test_break_view(windows):
    """Test the BreakTask view.

    """
    show_and_close_widget(BreakView(task=BreakTask(name='Test')))
Esempio n. 35
0
def test_view(windows):
    """Test the SleepTask view.

    """
    show_and_close_widget(SleepView(task=SleepTask(name='Test')))
def test_continue_view(windows):
    """Test the ContinueTask view.

    """
    show_and_close_widget(ContinueView(task=ContinueTask(name='Test')))
Esempio n. 37
0
def test_view(windows):
    """Test the SleepTask view.

    """
    show_and_close_widget(SleepView(task=SleepTask(name="Test")))
Esempio n. 38
0
def test_view(windows):
    """Test the FormulaTask view.

    """
    show_and_close_widget(DefinitionView(task=DefinitionTask(name='Test')))
Esempio n. 39
0
def test_view(windows):
    """Test the LogTask view.

    """
    show_and_close_widget(LogView(task=LogTask(name='Test')))
Esempio n. 40
0
def test_view(windows):
    """Test the LogTask view.

    """
    show_and_close_widget(LogView(task=LogTask(name='Test')))
Esempio n. 41
0
def test_while_view(windows):
    """Test the ContinueTask view.

    """
    show_and_close_widget(WhileView(task=WhileTask(name='Test')))
Esempio n. 42
0
def test_while_view(windows):
    """Test the ContinueTask view.

    """
    show_and_close_widget(WhileView(task=WhileTask(name='Test')))
Esempio n. 43
0
def test_view(windows):
    """Test the FormulaTask view.

    """
    show_and_close_widget(FormulaView(task=FormulaTask(name='Test')))
Esempio n. 44
0
def test_view(windows):
    """Test the ConditionalTask view.

    """
    show_and_close_widget(ConditionalView(task=ConditionalTask(name='Test')))
Esempio n. 45
0
def test_view(windows):
    """Test the ConditionalTask view.

    """
    show_and_close_widget(ConditionalView(task=ConditionalTask(name='Test')))
Esempio n. 46
0
def test_continue_view(windows):
    """Test the ContinueTask view.

    """
    show_and_close_widget(ContinueView(task=ContinueTask(name='Test')))
Esempio n. 47
0
def test_break_view(windows):
    """Test the BreakTask view.

    """
    show_and_close_widget(BreakView(task=BreakTask(name='Test')))
Esempio n. 48
0
def test_instr_view_display(instr_view):
    """Test displaying the instyr_view.

    """
    show_and_close_widget(instr_view)
Esempio n. 49
0
def test_instr_view_display(instr_view):
    """Test displaying the instyr_view.

    """
    show_and_close_widget(instr_view)