def test_mappings_needed(): ctrl = fc.FixtureController(85) mappings = [] with pytest.raises(RuntimeError) as excinfo: data = ctrl.run(mappings) assert "sensor mappings needed to gather calibration data" in str( excinfo.value)
def test_run(): ctrl = fc.FixtureController() mappings = [ (555, 1), (1234, 2), ] data = ctrl.run(mappings) assert data is not None
def test_run_temp(): ctrl = fc.FixtureController(85) mappings = [ (555, 1), (1234, 2), ] data = ctrl.run(mappings) assert data is not None assert len(data) == 160
def test_multi_fixtures(): ctrl = fc.FixtureController(85) mappings = [ (555, 1), (1234, 2), (1735, 3), ] data = ctrl.run(mappings) assert data is not None assert len(data) == 160
def __init__(self, parent = None): QObject.__init__(self, parent) engine = QtQml.QQmlApplicationEngine() engine.rootContext().setContextProperty("ui_control", self) url = QtCore.QUrl.fromLocalFile('./qml/main.qml') engine.load(url) self._engine = engine fc = fixt.FixtureController() self._calib_workflow = cwc.CalibrationWorkflowController(fc, self) self._sensor_mappings = []
def main(): """ Run our two sample data sets to start """ # simple_plot() # mock_data_plot() # fc = tcw.MockFixtureController() fc = fixt.FixtureController() tui = ui.TextUI() tc = cw.CalibrationWorkflowController(fc, tui) tc.run()
def test_run_data(): ctrl = fc.FixtureController(85) mappings = [ (555, 1), ] data = ctrl.run(mappings) assert data is not None assert len(data) == 160 time, temperature, readings = data[0] assert isinstance(time, str) assert isinstance(temperature, float) assert isinstance(readings, list)
def test_full_data_run(): fc = fixture_controller.FixtureController() ui = MockUI() tc = CalibrationWorkflowController(fc, ui) tc.run()