Пример #1
0
 def test_launch_isocline(self):
     """
     Check that all required keys are present in output from PSE Discrete Adapter launch.
     """
     viewer = IsoclinePSEAdapter()
     result = viewer.launch(self.group)
     assert viewer._ui_name == result["title"]
     assert 1 == len(result["available_metrics"])
Пример #2
0
 def test_launch_isocline(self):
     """
     Check that all required keys are present in output from PSE Discrete Adapter launch.
     """
     viewer = IsoclinePSEAdapter()
     result = viewer.launch(self.group)
     assert viewer._ui_name == result["title"]
     assert 1 == len(result["available_metrics"])
Пример #3
0
 def test_launch_isocline(self):
     """
     Check that all required keys are present in output from PSE Discrete Adapter launch.
     """
     viewer = IsoclinePSEAdapter()
     result = viewer.launch(self.group)
     self.assertEqual(viewer._ui_name, result["title"])
     self.assertEqual(TvbProfile.current.web.MPLH5_SERVER_URL, result["mplh5ServerURL"])
     self.assertEqual(1, len(result["figureNumbers"]))
     self.assertEqual(1, len(result["metrics"]))
Пример #4
0
 def test_launch_isocline(self):
     """
     Check that all required keys are present in output from PSE Discrete Adapter launch.
     """
     viewer = IsoclinePSEAdapter()
     result = viewer.launch(self.group)
     self.assertEqual(viewer._ui_name, result["title"])
     self.assertEqual(config.SERVER_IP, result["serverIp"])
     self.assertEqual(config.MPLH5_SERVER_PORT, result["serverPort"])
     self.assertEqual(0, len(result["figureNumbers"]))
     self.assertEqual(0, len(result["metrics"]))
Пример #5
0
 def test_launch_isocline(self, datatype_group_factory):
     """
     Check that all required keys are present in output from PSE Discrete Adapter launch.
     """
     viewer = IsoclinePSEAdapter()
     view_model = viewer.get_view_model_class()()
     group = datatype_group_factory()
     view_model.datatype_group = UUID(hex=group.gid)
     result = viewer.launch(view_model)
     assert viewer._ui_name == result["title"]
     assert 1 == len(result["available_metrics"])
Пример #6
0
 def test_launch_isocline(self):
     """
     Check that all required keys are present in output from PSE Discrete Adapter launch.
     """
     viewer = IsoclinePSEAdapter()
     result = viewer.launch(self.group)
     self.assertEqual(viewer._ui_name, result["title"])
     self.assertEqual(TvbProfile.current.web.MPLH5_SERVER_URL,
                      result["mplh5ServerURL"])
     self.assertEqual(1, len(result["figureNumbers"]))
     self.assertEqual(1, len(result["metrics"]))
Пример #7
0
    def test_launch_isocline_order_operations(self, datatype_group_factory,
                                              operation_factory,
                                              time_series_index_factory,
                                              datatype_measure_factory):
        dt_group = datatype_group_factory()
        self._add_extra_operation_in_group(dt_group, operation_factory,
                                           time_series_index_factory,
                                           datatype_measure_factory)

        viewer = IsoclinePSEAdapter()
        view_model = viewer.get_view_model_class()()
        view_model.datatype_group = dt_group.gid
        result = viewer.launch(view_model)

        assert viewer._ui_name == result["title"]
        assert 1 == len(result["available_metrics"])
        matrix_shape = json.loads(result['matrix_shape'])
        matrix_data = json.loads(result['matrix_data'])
        matrix_data = numpy.reshape(matrix_data, matrix_shape)
        assert matrix_data[0][1] == 4
        # We replace NaN with vmin-1, which is 2 in this case:
        assert matrix_data[1][1] == 2