本文整理汇总了Python中tvb.tests.framework.core.test_factory.TestFactory.create_figure方法的典型用法代码示例。如果您正苦于以下问题:Python TestFactory.create_figure方法的具体用法?Python TestFactory.create_figure怎么用?Python TestFactory.create_figure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tvb.tests.framework.core.test_factory.TestFactory
的用法示例。
在下文中一共展示了TestFactory.create_figure方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_displayresultfigures
# 需要导入模块: from tvb.tests.framework.core.test_factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.test_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']
self.assertEqual(set([fig.id for fig in figures]), {figure1.id, figure2.id})
示例2: test_editresultfigures_rename_session
# 需要导入模块: from tvb.tests.framework.core.test_factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.test_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")
self.assertEqual(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")
self.assertEqual(len(figs['test']), 0)
self.assertEqual(previews['test_renamed'], 2)
示例3: test_editresultfigures_remove_fig
# 需要导入模块: from tvb.tests.framework.core.test_factory import TestFactory [as 别名]
# 或者: from tvb.tests.framework.core.test_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)
self.assertEqual(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)
self.assertEqual(len(figs), 0)