コード例 #1
0
 def transactional_setup_method(self):
     """
     Sets up the environment for running the tests;
     creates a test user, a test project and a `Sensors_Importer`
     """
     self.test_user = TestFactory.create_user('Sensors_User')
     self.test_project = TestFactory.create_project(self.test_user, "Sensors_Project")
     self.importer = SensorsImporter()
コード例 #2
0
ファイル: 4750_update_code.py プロジェクト: yop0/tvb-root
def update():
    """
    Update TVB code to SVN revision version 4770.
    This update was done for release 1.0.5
    """
    projects_count = dao.get_all_projects(is_count=True)
    
    for page_start in range(0, projects_count, PAGE_SIZE):
        projects_page = dao.get_all_projects(page_start=page_start, page_size=PAGE_SIZE)
        
        for project in projects_page:
            try:
                adapter = SensorsImporter()
                FlowService().fire_operation(adapter, dao.get_system_user(), project.id, visible=False,
                                             sensors_file=DATA_FILE, sensors_type=SensorsImporter.INTERNAL_SENSORS)
            except Exception as excep:
                LOGGER.exception(excep)