Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_view2(self):
# Intantiate a view with a selected interface.
interface = LinspaceLoopInterface()
self.task.interface = interface
window = enaml.widgets.api.Window()
core = self.workbench.get_plugin('enaml.workbench.core')
LoopView(window, task=self.task, core=core)
window.show()
process_app_events()
assert_is(self.task.interface, interface)
def close_all_windows():
qapp = QtApplication.instance()._qapp
qapp.flush()
qapp.processEvents()
sleep(0.1)
for window in Window.windows:
window.close()
qapp.flush()
qapp.processEvents()
def get_window(qtbot, cls=Window, timeout=1000):
"""Convenience function running the event loop and returning the first
window found in the set of active windows.
Parameters
----------
cls : type, optional
Type of the window which should be returned.
timeout : int, optional
Timeout after which the operation should fail in ms
Returns
-------
window : Window or None
Return the first window found matching the specified class
def test_view1(self):
# Intantiate a view with no selected interface and select one after
window = enaml.widgets.api.Window()
core = self.workbench.get_plugin('enaml.workbench.core')
view = RFFrequencyView(window, task=self.task, core=core)
window.show()
process_app_events()
assert_in('AgilentPNA', view.drivers)
self.task.selected_driver = 'AgilentPNA'
process_app_events()
assert_is_instance(self.task.interface, PNASetRFFrequencyInterface)
def test_view1(self):
# Intantiate a view with no selected interface and select one after
window = enaml.widgets.api.Window()
core = self.workbench.get_plugin('enaml.workbench.core')
view = LoopView(window, task=self.task, core=core)
window.show()
process_app_events()
view.widgets()[1].selected = LinspaceLoopInterface
process_app_events()
assert_is_instance(self.task.interface, LinspaceLoopInterface)
view.widgets()[1].selected = IterableLoopInterface
process_app_events()
assert_is_instance(self.task.interface, IterableLoopInterface)
def test_view(self):
# Intantiate a view with no selected interface and select one after
window = enaml.widgets.api.Window()
view = ArrayExtremaView(window, task=self.task)
window.show()
process_app_events()
def test_view1(self):
# Intantiate a view with no selected interface and select one after
window = enaml.widgets.api.Window()
core = self.workbench.get_plugin('enaml.workbench.core')
view = SteppingView(window, task=self.task, core=core)
window.show()
process_app_events()
def test_view1(self):
# Intantiate a view with no selected interface and select one after
window = enaml.widgets.api.Window()
core = self.workbench.get_plugin('enaml.workbench.core')
view = SetDcVoltageView(window, task=self.task, core=core)
window.show()
process_app_events()
assert_in('YokogawaGS200', view.drivers)
self.task.selected_driver = 'YokogawaGS200'
process_app_events()
assert_is(self.task.interface, None)
assert_in('TinyBilt', view.drivers)
self.task.selected_driver = 'TinyBilt'
process_app_events()
assert_is_instance(self.task.interface,
MultiChannelVoltageSourceInterface)
def test_view1(self):
# Intantiate a view with no selected interface and select one after
window = enaml.widgets.api.Window()
core = self.workbench.get_plugin('enaml.workbench.core')
view = RFPowerView(window, task=self.task, core=core)
window.show()
process_app_events()
assert_in('AgilentE8257D', view.drivers)
self.task.selected_driver = 'AgilentE8257D'
process_app_events()
assert_is(self.task.interface, None)
def test_view2(self):
# Intantiate a view with a selected interface.
self.task.interface = PNASetRFFrequencyInterface(task=self.task)
self.task.frequency = '1.0'
self.task.selected_driver = 'AgilentPNA'
interface = self.task.interface
window = enaml.widgets.api.Window()
core = self.workbench.get_plugin('enaml.workbench.core')
RFFrequencyView(window, task=self.task, core=core)
window.show()
process_app_events()
assert_is(self.task.interface, interface)