def test_header_errors2(self): """ Test presence of build_header in Header. """ self.workbench.register(MeasureManifest()) self.workbench.register(DummyHeader2()) self.workbench.get_plugin(u'hqc_meas.measure')
def test_engine_errors2(self): """ Test presence of factory in Engine. """ self.workbench.register(MeasureManifest()) self.workbench.register(DummyEngine2()) self.workbench.get_plugin(u'hqc_meas.measure')
def test_check_errors2(self): """ Test presence of perfom_test in Check. """ self.workbench.register(MeasureManifest()) self.workbench.register(DummyCheck2()) self.workbench.get_plugin(u'hqc_meas.measure')
def test_engine_errors3(self): """ Test enforcement of type for Engine when using factory. """ self.workbench.register(MeasureManifest()) self.workbench.register(DummyEngine4()) self.workbench.get_plugin(u'hqc_meas.measure')
def test_monitor_errors2(self): """ Test presence of factory in Monitor. """ self.workbench.register(MeasureManifest()) self.workbench.register(DummyMonitor2()) self.workbench.get_plugin(u'hqc_meas.measure')
def test_check_errors1(self): """ Test uniqueness of check id. """ self.workbench.register(MeasureManifest()) self.workbench.register(DummyCheck1()) self.workbench.register(DummyCheck1bis()) self.workbench.get_plugin(u'hqc_meas.measure')
def test_engine_errors1(self): """ Test uniqueness of engine id. """ self.workbench.register(MeasureManifest()) self.workbench.register(DummyEngine1()) self.workbench.register(DummyEngine1bis()) self.workbench.get_plugin(u'hqc_meas.measure')
def test_monitor_errors1(self): """ Test uniqueness of monitor id. """ self.workbench.register(MeasureManifest()) self.workbench.register(DummyMonitor1()) self.workbench.register(DummyMonitor1bis()) self.workbench.get_plugin(u'hqc_meas.measure')
def setup(self): self.workbench = Workbench() self.workbench.register(CoreManifest()) self.workbench.register(StateManifest()) self.workbench.register(PreferencesManifest()) self.workbench.register(DependenciesManifest()) self.workbench.register(TaskManagerManifest()) self.workbench.register(MeasureManifest()) self.workbench.register(TestSuiteManifest())
def setup(self): self.workbench = Workbench() self.workbench.register(CoreManifest()) self.workbench.register(UIManifest()) self.workbench.register(StateManifest()) self.workbench.register(PreferencesManifest()) self.workbench.register(LogManifest()) self.workbench.register(MeasureManifest()) # Needed otherwise the monitor manifest is not registered. self.workbench.get_plugin(u'hqc_meas.measure')
def setup(self): self.workbench = Workbench() self.workbench.register(CoreManifest()) self.workbench.register(UIManifest()) self.workbench.register(HqcAppManifest()) self.workbench.register(StateManifest()) self.workbench.register(PreferencesManifest()) self.workbench.register(LogManifest()) self.workbench.register(TaskManagerManifest()) self.workbench.register(InstrManagerManifest()) self.workbench.register(MeasureManifest()) self.workbench.register(TestSuiteManifest())
def test_check_factory(self): """ Test getting the Check decl from a factory. """ self.workbench.register(MeasureManifest()) self.workbench.register(DummyCheck3()) plugin = self.workbench.get_plugin(u'hqc_meas.measure') assert_in(u'dummy.check3', plugin.checks) self.workbench.unregister(u'dummy.check3') assert_not_in(u'dummy.check3', plugin.checks)
def test_check_registration2(self): """ Test checks update when a new plugin is registered. """ self.workbench.register(MeasureManifest()) plugin = self.workbench.get_plugin(u'hqc_meas.measure') self.workbench.register(DummyCheck1()) assert_in(u'dummy.check1', plugin.checks) self.workbench.unregister(u'dummy.check1') assert_not_in(u'dummy.check1', plugin.checks)
def test_engine_factory(self): """ Test getting the Engine decl from a factory. """ self.workbench.register(MeasureManifest()) self.workbench.register(DummyEngine3()) plugin = self.workbench.get_plugin(u'hqc_meas.measure') assert_in(u'dummy.engine3', plugin.engines) self.workbench.unregister(u'dummy.engine3') assert_not_in(u'dummy.engine3', plugin.engines)
def test_engine_registration2(self): """ Test engines update when a new plugin is registered. """ self.workbench.register(MeasureManifest()) plugin = self.workbench.get_plugin(u'hqc_meas.measure') self.workbench.register(DummyEngine1()) assert_in(u'dummy.engine1', plugin.engines) self.workbench.unregister(u'dummy.engine1') assert_not_in(u'dummy.engine1', plugin.engines)
def test_monitor_registration2(self): """ Test monitors update when a new plugin is registered. """ self.workbench.register(MeasureManifest()) plugin = self.workbench.get_plugin(u'hqc_meas.measure') self.workbench.register(DummyMonitor1()) assert_in(u'dummy.monitor1', plugin.monitors) self.workbench.unregister(u'dummy.monitor1') assert_not_in(u'dummy.monitor1', plugin.monitors)
def test_monitor_factory(self): """ Test getting the Monitor decl from a factory. """ self.workbench.register(MeasureManifest()) self.workbench.register(DummyMonitor3()) plugin = self.workbench.get_plugin(u'hqc_meas.measure') assert_in(u'dummy.monitor3', plugin.monitors) self.workbench.unregister(u'dummy.monitor3') assert_not_in(u'dummy.monitor3', plugin.monitors)
def test_selected_engine2(self): """ Test selected engine from preferences is deleted if not found. """ # Tamper with prefs to alter startup. pref_plugin = self.workbench.get_plugin(u'hqc_meas.preferences') prefs = {'selected_engine': u'dummy.engine1'} pref_plugin._prefs[u'hqc_meas.measure'].update(prefs) self.workbench.register(MeasureManifest()) plugin = self.workbench.get_plugin(u'hqc_meas.measure') pref_plugin._prefs[u'hqc_meas.measure'] = {} assert_equal(plugin.selected_engine, u'')
def test_engine_registation1(self): """ Test that engines are properly found at start-up. """ self.workbench.register(MeasureManifest()) self.workbench.register(DummyEngine1()) plugin = self.workbench.get_plugin(u'hqc_meas.measure') assert_in(u'dummy.engine1', plugin.engines) self.workbench.unregister(u'dummy.engine1') assert_not_in(u'dummy.engine1', plugin.engines) assert_equal(plugin._engine_extensions, {})
def test_selected_engine3(self): """ Test observer is called when new engine selected. """ self.workbench.register(MeasureManifest()) self.workbench.register(DummyEngine1()) plugin = self.workbench.get_plugin(u'hqc_meas.measure') plugin.selected_engine = u'dummy.engine1' assert plugin.engines[u'dummy.engine1'].post_selected plugin.selected_engine = u'' assert plugin.engines[u'dummy.engine1'].post_deselected
def test_init(self): """ Test automatic registration at init. """ # Tamper with prefs to alter startup. pref_plugin = self.workbench.get_plugin(u'hqc_meas.preferences') prefs = { 'manifests': repr([('tests.measurement.dummies', 'DummyCheck1')]) } pref_plugin._prefs[u'hqc_meas.measure'].update(prefs) self.workbench.register(MeasureManifest()) plugin = self.workbench.get_plugin(u'hqc_meas.measure') pref_plugin._prefs[u'hqc_meas.measure'] = {} assert_in(u'dummy.check1', plugin._manifest_ids) assert_in(u'dummy.check1', plugin.checks)
def setup(self): self.workbench = Workbench() self.workbench.register(CoreManifest()) self.workbench.register(UIManifest()) self.workbench.register(HqcAppManifest()) self.workbench.register(StateManifest()) self.workbench.register(PreferencesManifest()) self.workbench.register(LogManifest()) self.workbench.register(DependenciesManifest()) self.workbench.register(TaskManagerManifest()) self.workbench.register(InstrManagerManifest()) self.workbench.register(MeasureManifest()) self.workbench.register(TestSuiteManifest()) # Adding by hand the false instr task. plugin = self.workbench.get_plugin('hqc_meas.task_manager') plugin._py_tasks['False instr'] = FalseInstrTask
"--nocapture", help="Don't capture stdout/stderr", action='store_false') args = parser.parse_args() workbench = Workbench() workbench.register(CoreManifest()) workbench.register(UIManifest()) workbench.register(HqcAppManifest()) workbench.register(StateManifest()) workbench.register(PreferencesManifest()) workbench.register(LogManifest()) workbench.register(DependenciesManifest()) workbench.register(TaskManagerManifest()) workbench.register(InstrManagerManifest()) workbench.register(MeasureManifest()) workbench.register(DebuggerManifest()) core = workbench.get_plugin('enaml.workbench.core') core.invoke_command('hqc_meas.logging.start_logging', {'std': args.nocapture}, workbench) core.invoke_command('enaml.workbench.ui.select_workspace', {'workspace': WORKSPACES[args.workspace]}, workbench) ui = workbench.get_plugin(u'enaml.workbench.ui') ui.show_window() ui.window.maximize() ui.start_application() workbench.unregister(u'hqc_meas.debug') workbench.unregister(u'hqc_meas.measure')