def test_launch(self):
        """
        Check that all required keys are present in output from BrainViewer launch.
        """
        zip_path = os.path.join(os.path.dirname(sensors_dataset.__file__),  'eeg_unitvector_62.txt.bz2')
        
        TestFactory.import_sensors(self.test_user, self.test_project, zip_path, 'EEG Sensors')
        sensors = TestFactory.get_entity(self.test_project, SensorsEEG())
        time_series = self.datatypeFactory.create_timeseries(self.connectivity, 'EEG', sensors)
        viewer = EegMonitor()
        result = viewer.launch(time_series)
        expected_keys = ['tsNames', 'groupedLabels', 'tsModes', 'tsStateVars', 'longestChannelLength',
                         'label_x', 'entities', 'page_size', 'number_of_visible_points',
                         'extended_view', 'initialSelection', 'ag_settings', 'ag_settings']

        for key in expected_keys:
            self.assertTrue(key in result, "key not found %s" % key)

        expected_ag_settings = ['channelsPerSet', 'channelLabels', 'noOfChannels', 'translationStep',
                                'normalizedSteps', 'nan_value_found', 'baseURLS', 'pageSize',
                                'nrOfPages', 'timeSetPaths', 'totalLength', 'number_of_visible_points',
                                'extended_view', 'measurePointsSelectionGIDs']

        ag_settings = json.loads(result['ag_settings'])

        for key in expected_ag_settings:
            self.assertTrue(key in ag_settings, "ag_settings should have the key %s" % key)
Example #2
0
    def test_launch(self, time_series_index_factory):
        """
        Check that all required keys are present in output from EegMonitor launch.
        """
        time_series_index = time_series_index_factory()
        viewer = EegMonitor()
        view_model = viewer.get_view_model_class()()
        view_model.input_data = time_series_index.gid
        result = viewer.launch(view_model)
        expected_keys = ['tsNames', 'groupedLabels', 'tsModes', 'tsStateVars', 'longestChannelLength',
                         'label_x', 'entities', 'page_size', 'number_of_visible_points',
                         'extended_view', 'initialSelection', 'ag_settings', 'ag_settings']

        for key in expected_keys:
            assert key in result, "key not found %s" % key

        expected_ag_settings = ['channelsPerSet', 'channelLabels', 'noOfChannels', 'translationStep',
                                'normalizedSteps', 'nan_value_found', 'baseURLS', 'pageSize',
                                'nrOfPages', 'timeSetPaths', 'totalLength', 'number_of_visible_points',
                                'extended_view', 'measurePointsSelectionGIDs']

        ag_settings = json.loads(result['ag_settings'])

        for key in expected_ag_settings:
            assert key in ag_settings, "ag_settings should have the key %s" % key
    def test_launch(self):
        """
        Check that all required keys are present in output from BrainViewer launch.
        """
        zip_path = os.path.join(os.path.dirname(sensors_dataset.__file__),
                                'EEG_unit_vectors_BrainProducts_62.txt.bz2')

        TestFactory.import_sensors(self.test_user, self.test_project, zip_path,
                                   'EEG Sensors')
        sensors = TestFactory.get_entity(self.test_project, SensorsEEG())
        time_series = self.datatypeFactory.create_timeseries(
            self.connectivity, 'EEG', sensors)
        viewer = EegMonitor()
        result = viewer.launch(time_series)
        expected_keys = [
            'tsStateVars', 'tsModes', 'translationStep', 'total_length',
            'title', 'timeSetPaths', 'number_of_visible_points',
            'normalizedSteps', 'noOfChannels', 'labelsForCheckBoxes',
            'label_x', 'graphLabels', 'entities', 'channelsPage'
        ]
        for key in expected_keys:
            self.assertTrue(key in result)
    def test_launch(self):
        """
        Check that all required keys are present in output from BrainViewer launch.
        """
        zip_path = os.path.join(os.path.dirname(sensors_dataset.__file__),
                                'EEG_unit_vectors_BrainProducts_62.txt.bz2')

        TestFactory.import_sensors(self.test_user, self.test_project, zip_path,
                                   'EEG Sensors')
        sensors = TestFactory.get_entity(self.test_project, SensorsEEG())
        time_series = self.datatypeFactory.create_timeseries(
            self.connectivity, 'EEG', sensors)
        viewer = EegMonitor()
        result = viewer.launch(time_series)
        expected_keys = [
            'tsNames', 'groupedLabels', 'tsModes', 'tsStateVars',
            'longestChannelLength', 'label_x', 'entities', 'page_size',
            'number_of_visible_points', 'extended_view', 'initialSelection',
            'ag_settings', 'ag_settings'
        ]

        for key in expected_keys:
            self.assertTrue(key in result, "key not found %s" % key)

        expected_ag_settings = [
            'channelsPerSet', 'channelLabels', 'noOfChannels',
            'translationStep', 'normalizedSteps', 'nan_value_found',
            'baseURLS', 'pageSize', 'nrOfPages', 'timeSetPaths', 'totalLength',
            'number_of_visible_points', 'extended_view',
            'measurePointsSelectionGIDs'
        ]

        ag_settings = json.loads(result['ag_settings'])

        for key in expected_ag_settings:
            self.assertTrue(key in ag_settings,
                            "ag_settings should have the key %s" % key)