Exemplo n.º 1
0
def test_tree_widget(exopy_qtbot):
    """Test the ConditionalTask view.

    """
    with enaml.imports():
        from .test_tree_widget import Main
    show_and_close_widget(exopy_qtbot, Main())
Exemplo n.º 2
0
def test_rf_power_view(exopy_qtbot, root_view, task_workbench):
    """Test RFPowerView widget outisde of a LoopTask.

    """
    task = SetRFPowerTask(name='Test')
    root_view.task.add_child_task(0, task)
    show_and_close_widget(exopy_qtbot, RFPowerView(task=task, root=root_view))
Exemplo n.º 3
0
    def test_view(self, exopy_qtbot, task_workbench):
        """Test the LoopTask view.

        """
        core = task_workbench.get_plugin('enaml.workbench.core')
        root = RootTaskView(core=core)
        show_and_close_widget(exopy_qtbot, LoopView(task=self.task, root=root))
Exemplo n.º 4
0
def test_lock_in_meas_view1(exopy_qtbot, 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(exopy_qtbot, LockInMeasView(task=task, root=root_view))
Exemplo n.º 5
0
def test_loop_config(exopy_qtbot, task_workbench):
    """Test the loop config.

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

    config = LoopTaskConfig(manager=plugin,
                            task_class=plugin.get_task('exopy.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('exopy.LoopTask'))

    assert not config.task_name
    assert not config.ready

    show_and_close_widget(exopy_qtbot, LoopConfigView(config=config))
Exemplo n.º 6
0
def test_py_task_config(exopy_qtbot, task_workbench):
    """Test the basic python task configurer.

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

    config = PyTaskConfig(manager=plugin,
                          task_class=plugin.get_task('exopy.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('exopy.ComplexTask'))

    assert not config.task_name
    assert not config.ready

    show_and_close_widget(exopy_qtbot, PyConfigView(config=config))
    show_and_close_widget(exopy_qtbot, PyConfigView(config=config, loop=True))
def test_set_dc_voltage_view(exopy_qtbot, root_view, task_workbench):
    """Test SetDCVoltageView widget outisde of a LoopTask.

    """
    task = SetDCVoltageTask(name='Test')
    root_view.task.add_child_task(0, task)
    show_and_close_widget(exopy_qtbot, SetDcVoltageView(task=task, root=root_view))
Exemplo n.º 8
0
    def test_view(self, exopy_qtbot, task_workbench):
        """Test the LoopTask view.

        """
        core = task_workbench.get_plugin('enaml.workbench.core')
        root = RootTaskView(core=core)
        show_and_close_widget(exopy_qtbot, LoopView(task=self.task, root=root))
def test_save_file_view(exopy_qtbot, root_view):
    """Test SaveView widget.

    """
    task = SaveFileTask(name='Test')
    root_view.task.add_child_task(0, task)
    show_and_close_widget(exopy_qtbot, SaveFileView(task=task, root=root_view))
Exemplo n.º 10
0
def test_pna_single_point_view(exopy_qtbot, 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(exopy_qtbot,
                          PNASinglePointView(task=task, root=root_view))
Exemplo n.º 11
0
def test_pna_power_view(exopy_qtbot, 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(exopy_qtbot, RFPowerView(task=task, root=root_view))
Exemplo n.º 12
0
def test_rf_frequency_view(exopy_qtbot, 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(exopy_qtbot,
                          RFFrequencyView(task=task, root=root_view))
Exemplo n.º 13
0
def test_apply_mag_field_view1(exopy_qtbot, 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(exopy_qtbot,
                          ApplyMagFieldView(task=task, root=root_view))
Exemplo n.º 14
0
    def test_view_interface_not_inline(self, exopy_qtbot, 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(exopy_qtbot, LoopView(task=self.task, root=root))
def test_set_dc_voltage_view2(exopy_qtbot, root_view, task_workbench):
    """Test MultiChannelVoltageSourceInterface views.

    """
    task = SetDCVoltageTask(name='Test')
    interface = MultiChannelVoltageSourceInterface(task=task)
    task.interface = interface
    root_view.task.add_child_task(0, task)
    show_and_close_widget(exopy_qtbot, SetDcVoltageView(task=task, root=root_view))
Exemplo n.º 16
0
def test_awg5014_context_view(exopy_qtbot):
    """Test displaying the context view.

    """
    root = RootSequence()
    context = AWG5014Context(sequence_name='Test')
    root.context = context
    show_and_close_widget(exopy_qtbot,
                          AWG5014ContextView(context=context, sequence=root))
Exemplo n.º 17
0
def test_pna_single_point_view2(exopy_qtbot, 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(exopy_qtbot,
                          PNASinglePointView(task=task, root=root_view))
Exemplo n.º 18
0
def test_apply_mag_field_view2(exopy_qtbot, 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(exopy_qtbot, LoopView(task=loop, root=root_view))
Exemplo n.º 19
0
def test_array_find_value_view(exopy_qtbot):
    """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(exopy_qtbot, ArrayFindValueView(task=task))
Exemplo n.º 20
0
    def test_view_interface_not_inline(self, exopy_qtbot, 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(exopy_qtbot, LoopView(task=self.task, root=root))
Exemplo n.º 21
0
def test_rf_frequency_view2(exopy_qtbot, 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(exopy_qtbot, LoopView(task=loop, root=root_view))
def test_set_dc_voltage_view3(exopy_qtbot, root_view, task_workbench):
    """Test SetDCVoltageView 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(exopy_qtbot, LoopView(task=loop, root=root_view))
def test_conditional_sequence_view(workbench, root, exopy_qtbot):
    """Test the view of the Pulse class.

    """
    import enaml
    from exopy.testing.util import show_and_close_widget
    with enaml.imports():
        from exopy_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(exopy_qtbot, RootSequenceView(item=root, core=core))
Exemplo n.º 24
0
def test_template_task_config(exopy_qtbot, task_workbench):
    """Test the template task configurer.

    """
    plugin = task_workbench.get_plugin('exopy.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(exopy_qtbot, TemplateConfigView(config=config))
Exemplo n.º 25
0
def test_text_monitor_declration_functions(text_monitor_workbench,
                                           exopy_qtbot):
    """Test that we can create a monitor and its views.

    """
    m_p = text_monitor_workbench.get_plugin('exopy.measurement')
    decl = m_p.get_declarations('monitor',
                                ['exopy.text_monitor'])['exopy.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(exopy_qtbot, DockItemTestingWindow(widget=item))
Exemplo n.º 26
0
def test_text_monitor_declration_functions(text_monitor_workbench,
                                           exopy_qtbot):
    """Test that we can create a monitor and its views.

    """
    m_p = text_monitor_workbench.get_plugin('exopy.measurement')
    decl = m_p.get_declarations('monitor',
                                ['exopy.text_monitor'])['exopy.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(exopy_qtbot, DockItemTestingWindow(widget=item))
Exemplo n.º 27
0
def test_reporting_on_extension_errors(exopy_qtbot, err_workbench):
    """Check reporting extension errors.

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

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

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

    widget = handler.report(err_workbench)
    assert isinstance(widget, HierarchicalErrorsDisplay)
    show_and_close_widget(exopy_qtbot, widget)
Exemplo n.º 28
0
def test_reporting_on_extension_errors(exopy_qtbot, err_workbench):
    """Check reporting extension errors.

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

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

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

    widget = handler.report(err_workbench)
    assert isinstance(widget, HierarchicalErrorsDisplay)
    show_and_close_widget(exopy_qtbot, widget)
Exemplo n.º 29
0
def test_pulse_view2(exopy_qtbot, workbench, pulse):
    """Test showing a pulse logical at the start.

    """
    import enaml
    from exopy.testing.util import show_and_close_widget
    with enaml.imports():
        from exopy_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(exopy_qtbot, root_view)
Exemplo n.º 30
0
def test_reporting_on_extension_errors(exopy_qtbot, instr_workbench):
    """Check reporting extension errors.

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

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

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

    widget = handler.report(instr_workbench)
    assert isinstance(widget, BasicErrorsDisplay)
    show_and_close_widget(exopy_qtbot, widget)
Exemplo n.º 31
0
def test_py_task_config(exopy_qtbot, task_workbench):
    """Test the basic python task configurer.

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

    root = RootTask()
    config = PyTaskConfig(manager=plugin,
                          task_class=plugin.get_task('exopy.ComplexTask'),
                          future_parent=root)

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

    config.task_name = ''
    assert not config.ready

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

    root.add_child_task(0, task)
    config2 = PyTaskConfig(manager=plugin,
                           task_class=plugin.get_task('exopy.ComplexTask'),
                           future_parent=root)

    config2.task_name = 'Test'
    assert not config2.ready

    config2.task_name = 'ADifferentName'
    assert config2.ready

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

    assert not config.task_name
    assert not config.ready

    show_and_close_widget(exopy_qtbot, PyConfigView(config=config))
    show_and_close_widget(exopy_qtbot, PyConfigView(config=config, loop=True))
Exemplo n.º 32
0
def test_loop_config(exopy_qtbot, task_workbench):
    """Test the loop config.

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

    root = RootTask()
    config = LoopTaskConfig(manager=plugin,
                            task_class=plugin.get_task('exopy.LoopTask'),
                            future_parent=root)

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

    config.task_name = ''
    assert not config.ready

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

    root.add_child_task(0, task)
    config2 = LoopTaskConfig(manager=plugin,
                             task_class=plugin.get_task('exopy.LoopTask'),
                             future_parent=root)

    config2.task_name = 'Test'
    assert not config2.ready

    config2.task_name = 'ADifferentName'
    assert config2.ready

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

    assert not config.task_name
    assert not config.ready

    show_and_close_widget(exopy_qtbot, LoopConfigView(config=config))
Exemplo n.º 33
0
def test_view(exopy_qtbot):
    """Test the SleepTask view.

    """
    show_and_close_widget(exopy_qtbot, SleepView(task=SleepTask(name='Test')))
Exemplo n.º 34
0
def test_view(exopy_qtbot):
    """Test the FormulaTask view.

    """
    show_and_close_widget(exopy_qtbot,
                          FormulaView(task=FormulaTask(name='Test')))
Exemplo n.º 35
0
def test_instr_view_display(instr_view, exopy_qtbot):
    """Test displaying the instyr_view.

    """
    show_and_close_widget(exopy_qtbot, instr_view)
Exemplo n.º 36
0
def test_while_view(exopy_qtbot):
    """Test the ContinueTask view.

    """
    show_and_close_widget(exopy_qtbot, WhileView(task=WhileTask(name='Test')))
Exemplo n.º 37
0
def test_view(exopy_qtbot):
    """Test the FormulaTask view.

    """
    show_and_close_widget(exopy_qtbot,
                          DefinitionView(task=DefinitionTask(name='Test')))
Exemplo n.º 38
0
def test_view(exopy_qtbot):
    """Test the LogTask view.

    """
    show_and_close_widget(exopy_qtbot, LogView(task=LogTask(name='Test')))
Exemplo n.º 39
0
def test_instr_view_display(instr_view, exopy_qtbot):
    """Test displaying the instyr_view.

    """
    show_and_close_widget(exopy_qtbot, instr_view)
Exemplo n.º 40
0
def test_view(exopy_qtbot):
    """Test the ConditionalTask view.

    """
    show_and_close_widget(exopy_qtbot,
                          ConditionalView(task=ConditionalTask(name='Test')))