当前位置: 首页>>代码示例>>Python>>正文


Python TestFactory.create_figure方法代码示例

本文整理汇总了Python中tvb.tests.framework.core.factory.TestFactory.create_figure方法的典型用法代码示例。如果您正苦于以下问题:Python TestFactory.create_figure方法的具体用法?Python TestFactory.create_figure怎么用?Python TestFactory.create_figure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tvb.tests.framework.core.factory.TestFactory的用法示例。


在下文中一共展示了TestFactory.create_figure方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_displayresultfigures

# 需要导入模块: from tvb.tests.framework.core.factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.factory.TestFactory import create_figure [as 别名]
    def test_displayresultfigures(self):
        """
        Tests result dictionary for the expected key/value
        """
        figure1 = TestFactory.create_figure(self.operation.id, self.test_user.id, 
                                            self.test_project.id, name="figure1", 
                                            path="path-to-figure1", session_name="test")
        figure2 = TestFactory.create_figure(self.operation.id, self.test_user.id, 
                                            self.test_project.id, name="figure2", 
                                            path="path-to-figure2", session_name="test")

        result_dict = self.figure_c.displayresultfigures()
        figures = result_dict['selected_sessions_data']['test']
        assert set([fig.id for fig in figures]) == {figure1.id, figure2.id}
开发者ID:maedoc,项目名称:tvb-framework,代码行数:16,代码来源:figure_controller_test.py

示例2: test_editresultfigures_rename_session

# 需要导入模块: from tvb.tests.framework.core.factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.factory.TestFactory import create_figure [as 别名]
 def test_editresultfigures_rename_session(self):
     """
     Tests result dictionary has the expected keys / values and call to `editresultfigures`
     correctly redirects to '/project/figure/displayresultfigures' on session renaming
     """
     cherrypy.request.method = 'POST'
     TestFactory.create_figure(self.operation.id, self.test_user.id, self.test_project.id, name="figure1",
                               path="path-to-figure1", session_name="test")
     TestFactory.create_figure(self.operation.id, self.test_user.id, self.test_project.id, name="figure2",
                               path="path-to-figure2", session_name="test")
     figs, _ = dao.get_previews(self.test_project.id, self.test_user.id, "test")  
     assert len(figs['test']) == 2
     data = {'old_session_name': 'test', 'new_session_name': 'test_renamed'}
     self._expect_redirect('/project/figure/displayresultfigures', self.figure_c.editresultfigures,
                           rename_session=True, **data)
     figs, previews = dao.get_previews(self.test_project.id, self.test_user.id, "test")
     assert len(figs['test']) == 0
     assert previews['test_renamed'] == 2
开发者ID:maedoc,项目名称:tvb-framework,代码行数:20,代码来源:figure_controller_test.py

示例3: test_editresultfigures_remove_fig

# 需要导入模块: from tvb.tests.framework.core.factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.factory.TestFactory import create_figure [as 别名]
 def test_editresultfigures_remove_fig(self):
     """
     Tests call to `editresultfigures` correctly redirects to '/project/figure/displayresultfigures'
     on figure removal
     """
     cherrypy.request.method = 'POST'
     figure1 = TestFactory.create_figure(self.operation.id, self.test_user.id, 
                                         self.test_project.id, name="figure1", 
                                         path="path-to-figure1", session_name="test")
     figs = dao.get_figures_for_operation(self.operation.id)
     assert len(figs) == 1
     data = {'figure_id': figure1.id}
     self._expect_redirect('/project/figure/displayresultfigures', self.figure_c.editresultfigures,
                           remove_figure=True, **data)
     figs = dao.get_figures_for_operation(self.operation.id)
     assert len(figs) == 0
开发者ID:maedoc,项目名称:tvb-framework,代码行数:18,代码来源:figure_controller_test.py


注:本文中的tvb.tests.framework.core.factory.TestFactory.create_figure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。