Пример #1
0
    def test_autoRun(self, qtbot, mocker):
        mw = SpotMotionMonitor()
        mw.show()
        qtbot.addWidget(mw)
        # Force camera setup
        mw.cameraController.setupCamera('GaussianCamera')
        mockCameraControllerAutoRun = mocker.patch.object(
            mw.cameraController, 'autoRun')

        args = collections.namedtuple('args', [
            'profile', 'telemetry_dir', 'config_file', 'auto_run',
            'vimba_camera_index'
        ])
        args.telemetry_dir = None
        args.auto_run = True

        mw.handleConfig(args)
        mw.autoRunIfNecessary()
        assert mockCameraControllerAutoRun.call_count == 1
Пример #2
0
    def test_commandLineConfiguration(self, qtbot, mocker):
        mw = SpotMotionMonitor()
        mw.show()
        qtbot.addWidget(mw)
        # Force camera setup
        mw.cameraController.setupCamera('GaussianCamera')

        args = collections.namedtuple('args', [
            'profile', 'telemetry_dir', 'config_file', 'auto_run',
            'vimba_camera_index'
        ])
        args.telemetry_dir = "/new/path/for/telemetry"
        args.auto_run = False
        filename = "test_new_config.yaml"
        args.config_file = filename
        self.write_config(filename)

        mw.handleConfig(args)
        assert mw.dataController.getDataConfiguration(
        ).fullTelemetrySavePath == args.telemetry_dir
        assert mw.dataController.bufferModel.bufferSize == 512

        os.remove(filename)